Commit 8f3527c6 authored by Fremondiere Bastien's avatar Fremondiere Bastien

Update RNG schema + Fix intro/conclu

parent bd4d1451
......@@ -11,7 +11,7 @@
<!-- Entry point -->
<xsl:template match="map">
<xsl:processing-instruction name="oxygen">
RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
RNGSchema="http://hdoc.crzt.fr/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
</xsl:processing-instruction>
<html>
<head>
......@@ -42,32 +42,30 @@
<xsl:value-of select="utc:remove-language(@TEXT)"/>
<xsl:value-of select="richcontent"/>
</h1>
<!--Introduction-->
<xsl:if test="child::*[contains(@TEXT, '#intro')]">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">introduction</xsl:attribute>
<xsl:value-of
select="utc:remove-language(child::*[contains(@TEXT, '#intro')][1]/@TEXT)"
/>
</xsl:element>
</xsl:if>
</header>
<!--Introduction-->
<xsl:if test="child::*[contains(@TEXT, '#intro')]">
<xsl:element name="section">
<header><h1>Introduction</h1>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">introduction</xsl:attribute>
<xsl:value-of select="utc:remove-language(child::*[contains(@TEXT, '#intro')][1]/@TEXT)"/>
</xsl:element>
</header>
</xsl:element>
</xsl:if>
<!-- Process children -->
<xsl:apply-templates select="node"/>
<!--Conclusion-->
<xsl:if test="child::*[contains(@TEXT, '#conclu')]">
<xsl:element name="section">
<header><h1>Conclusion</h1></header>
<footer>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute>
<xsl:value-of select="utc:remove-language(child::*[contains(@TEXT, '#conclu')][1]/@TEXT)"/>
</xsl:element>
</footer>
</xsl:element>
</xsl:if>
<footer>
<!--Conclusion-->
<xsl:if test="child::*[contains(@TEXT, '#conclu')]">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute>
<xsl:value-of
select="utc:remove-language(child::*[contains(@TEXT, '#conclu')][1]/@TEXT)"
/>
</xsl:element>
</xsl:if>
</footer>
</xsl:element>
</xsl:template>
......@@ -79,7 +77,7 @@
<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:value-of select="child::attribute[@NAME='anchor'][1]/@VALUE"/>
</xsl:attribute>
</xsl:if>
<header>
......@@ -111,7 +109,8 @@
</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="node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]"
priority="3"/>
<xsl:template match="richcontent">
<xsl:value-of select="utc:remove-language(html/body/p)"/>
......@@ -119,9 +118,9 @@
<!-- Utility functions -->
<xsl:function name="utc:remove-language" as="xs:string">
<xsl:param name="text" as="xs:string?" />
<xsl:param name="text" as="xs:string?"/>
<xsl:variable name="text2" select="string($text)"/>
<xsl:value-of select="replace($text2,'(#[0-9a-z]* )+','')"></xsl:value-of>
<xsl:value-of select="replace($text2,'(#[0-9a-z]* )+','')"/>
</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