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

Update RNG schema + Fix intro/conclu

parent bd4d1451
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<!-- Entry point --> <!-- Entry point -->
<xsl:template match="map"> <xsl:template match="map">
<xsl:processing-instruction name="oxygen"> <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> </xsl:processing-instruction>
<html> <html>
<head> <head>
...@@ -42,32 +42,30 @@ ...@@ -42,32 +42,30 @@
<xsl:value-of select="utc:remove-language(@TEXT)"/> <xsl:value-of select="utc:remove-language(@TEXT)"/>
<xsl:value-of select="richcontent"/> <xsl:value-of select="richcontent"/>
</h1> </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> </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 --> <!-- Process children -->
<xsl:apply-templates select="node"/> <xsl:apply-templates select="node"/>
<!--Conclusion--> <footer>
<xsl:if test="child::*[contains(@TEXT, '#conclu')]"> <!--Conclusion-->
<xsl:element name="section"> <xsl:if test="child::*[contains(@TEXT, '#conclu')]">
<header><h1>Conclusion</h1></header> <xsl:element name="div">
<footer> <xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute>
<xsl:element name="div"> <xsl:value-of
<xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute> select="utc:remove-language(child::*[contains(@TEXT, '#conclu')][1]/@TEXT)"
<xsl:value-of select="utc:remove-language(child::*[contains(@TEXT, '#conclu')][1]/@TEXT)"/> />
</xsl:element> </xsl:element>
</footer> </xsl:if>
</xsl:element> </footer>
</xsl:if>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
...@@ -79,7 +77,7 @@ ...@@ -79,7 +77,7 @@
<xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute> <xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute>
<xsl:if test="child::attribute[@NAME='anchor']"> <xsl:if test="child::attribute[@NAME='anchor']">
<xsl:attribute name="id"> <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:attribute>
</xsl:if> </xsl:if>
<header> <header>
...@@ -111,7 +109,8 @@ ...@@ -111,7 +109,8 @@
</xsl:template> </xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing --> <!-- 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:template match="richcontent">
<xsl:value-of select="utc:remove-language(html/body/p)"/> <xsl:value-of select="utc:remove-language(html/body/p)"/>
...@@ -119,9 +118,9 @@ ...@@ -119,9 +118,9 @@
<!-- Utility functions --> <!-- Utility functions -->
<xsl:function name="utc:remove-language" as="xs:string"> <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: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:function>
</xsl:stylesheet> </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