Commit d94792fb authored by Zangdar1111's avatar Zangdar1111

ajout ordonanncement fonctionnel

parent 92ab1272
......@@ -37,11 +37,14 @@
<xsl:element name="section">
<header>
<h1>
<xsl:value-of select="@TEXT"/>
<xsl:value-of select="utc:string-remove-order('#1 test')"></xsl:value-of>
<xsl:value-of select="utc:string-remove-order(@TEXT)"/>
<xsl:value-of select="richcontent"/>
</h1>
</header>
<xsl:apply-templates select="node"/>
<xsl:apply-templates select="./node">
<xsl:sort select="string(999-number(substring-after(tokenize(@TEXT,' ')[matches(.,'#([1-9][0-9]*)')],'#')))" order="descending" data-type="number" stable="yes"></xsl:sort>
</xsl:apply-templates>
</xsl:element>
</xsl:template>
......@@ -49,16 +52,11 @@
<xsl:template
match="node[not(node)]|node[child::*[contains(@TEXT, '#p')]]|node[child::*[contains(@TEXT, '#a')]]"
priority="1">
<xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl">
<xd:desc>
<xd:p/>
</xd:desc>
</xd:doc>
<xsl:element name="section">
<xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute>
<header>
<h1>
<xsl:value-of select="@TEXT"/>
<xsl:value-of select="utc:string-remove-order(@TEXT)"/>
<xsl:value-of select="richcontent"/>
</h1>
</header>
......@@ -68,7 +66,7 @@
<xsl:template match="node[contains(@TEXT, '#p')]" priority="2">
<xsl:element name="p">
<xsl:value-of select="utc:string-remove-all(@TEXT, '#p ')"/>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#p '))"/>
</xsl:element>
</xsl:template>
......@@ -76,9 +74,9 @@
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
<xsl:value-of select="utc:string-remove-all(@TEXT, '#a ')"/>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#a '))"/>
</xsl:attribute>
<xsl:value-of select="utc:string-remove-all(@TEXT, '#a ')"/>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#a '))"/>
</xsl:element>
</xsl:template>
......@@ -116,4 +114,11 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:function name="utc:string-remove-order" as="xs:string">
<xsl:param name="text" as="xs:string?" />
<xsl:variable name="text2" select="string($text)"/>
<xsl:value-of select="replace($text2,'#[1-9][0-9]* ','')"></xsl:value-of>
</xsl:function>
</xsl:stylesheet>
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