Commit 0b31fbd1 authored by Fremondiere Bastien's avatar Fremondiere Bastien

Update the_witcher.mm + Fix link + Done intro and conclu

parent 1f7ea5e7
<map version="1.0.1">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1449485059502" ID="ID_1970904157" MODIFIED="1449733283013">
<node CREATED="1449486713098" ID="ID_983701334" MODIFIED="1449486715515" TEXT="#intro Une introduction"/>
<node CREATED="1449486720318" ID="ID_737906523" MODIFIED="1449486722975" TEXT="#conclu Une conclusion"/>
<richcontent TYPE="NODE"><html>
<head>
......@@ -36,8 +38,6 @@
</node>
<node CREATED="1449485926526" ID="ID_289476678" MODIFIED="1449486753624" POSITION="left" TEXT="Sc&#xe9;nario">
<node CREATED="1449485946398" ID="ID_596698657" MODIFIED="1449734206316" TEXT="#p Mon personnage bien a&#xee;m&#xe9; attaque tous les monstres alentours pour de l&apos;argent"/>
<node CREATED="1449486713098" ID="ID_983701334" MODIFIED="1449486715515" TEXT="#intro"/>
<node CREATED="1449486720318" ID="ID_737906523" MODIFIED="1449486722975" TEXT="#conclu"/>
<node CREATED="1449486747017" ID="ID_1777634105" MODIFIED="1449486750554" TEXT="#mcq"/>
</node>
</node>
......
......@@ -5,8 +5,10 @@
<!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"-->
<xsl:output method="xml" indent="yes"/>
<!-- Remove spaces/tabs -->
<xsl:strip-space elements="*"/>
<!-- Entry point -->
<xsl:template match="map">
<xsl:processing-instruction name="oxygen">
RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
......@@ -22,7 +24,7 @@
</xsl:template>
<!-- Header in hdoc -->
<xsl:template match="node[1]" mode="header">
<title>
<xsl:value-of select="@TEXT"/>
......@@ -41,7 +43,26 @@
<xsl:value-of select="richcontent"/>
</h1>
</header>
<!--Introduction-->
<xsl:if test="child::*[contains(@TEXT, '#intro')]">
<xsl:element name="section">
<xsl:attribute name="data-hdoc-type">introduction</xsl:attribute>
<xsl:value-of
select="utc:string-remove-all(child::*[contains(@TEXT, '#intro')][1]/@TEXT, '#intro ')"
/>
</xsl:element>
</xsl:if>
<!-- Process children -->
<xsl:apply-templates select="node"/>
<!--Conclusion-->
<xsl:if test="child::*[contains(@TEXT, '#conclu')]">
<xsl:element name="section">
<xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute>
<xsl:value-of
select="utc:string-remove-all(child::*[contains(@TEXT, '#conclu')][1]/@TEXT, '#conclu ')"
/>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:template>
......@@ -51,11 +72,16 @@
priority="1">
<xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl">
<xd:desc>
<xd:p/>
<xd:p/>
</xd:desc>
</xd:doc>
<xsl:element name="section">
<xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute>
<xsl:if test="child::attribute[@NAME='anchor']">
<xsl:attribute name="id">
<xsl:value-of select="child::attribute[@NAME='anchor'][1]/@VALUE"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<header>
<h1>
<xsl:value-of select="@TEXT"/>
......@@ -66,12 +92,14 @@
</xsl:element>
</xsl:template>
<!-- Paragraph -->
<xsl:template match="node[contains(@TEXT, '#p')]" priority="2">
<xsl:element name="p">
<xsl:value-of select="utc:string-remove-all(@TEXT, '#p ')"/>
</xsl:element>
</xsl:template>
<!-- Link : need to use anchor attribute ? -->
<xsl:template match="node[contains(@TEXT, '#a')]" priority="2">
<xsl:element name="a">
<xsl:attribute name="href">
......@@ -82,12 +110,14 @@
</xsl:element>
</xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing -->
<xsl:template match="node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]" priority="3"/>
<xsl:template match="richcontent">
<xsl:value-of select="html/body/p"/>
</xsl:template>
<!-- Utility functions -->
<xsl:function name="utc:string-remove-all" as="xs:string">
<xsl:param name="text" as="xs:string"/>
<xsl:param name="replace" as="xs:string"/>
......@@ -97,7 +127,7 @@
<xsl:with-param name="replace" select="$replace"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$ret"></xsl:value-of>
<xsl:value-of select="$ret"/>
</xsl:function>
<xsl:template name="string-remove-all">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment