Commit 019dc717 authored by Fabien Boucaud's avatar Fabien Boucaud

Adding new files for structuration of the hdoc based on the titles of the...

Adding new files for structuration of the hdoc based on the titles of the framapad + necessary modifications in the .ant and the xhtml2hdoc.xsl
parent 47b9ad32
......@@ -30,7 +30,21 @@
style="${xsl}/html2xhtmlv2.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad3.xhtml" out="${tmp}/${properName}/tmpPad4.xhtml"
style="${xsl}/html2xhtml3.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad4.xhtml" out="${tmp}/${properName}/tozip/content.xml"
<xslt in="${tmp}/${properName}/tmpPad4.xhtml" out="${tmp}/${properName}/tmpPad5.xhtml"
style="${xsl}/html2hdocstruct1.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad5.xhtml" out="${tmp}/${properName}/tmpPad6.xhtml"
style="${xsl}/html2hdocstruct2.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad6.xhtml" out="${tmp}/${properName}/tmpPad7.xhtml"
style="${xsl}/html2hdocstruct3.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad7.xhtml" out="${tmp}/${properName}/tmpPad8.xhtml"
style="${xsl}/html2hdocstruct4.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad8.xhtml" out="${tmp}/${properName}/tmpPad9.xhtml"
style="${xsl}/html2hdocstruct5.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad9.xhtml" out="${tmp}/${properName}/tmpPad10.xhtml"
style="${xsl}/html2hdocstruct6.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad10.xhtml" out="${tmp}/${properName}/tmpPad11.xhtml"
style="${xsl}/html2hdocstructdivsection.xsl"/>
<xslt in="${tmp}/${properName}/tmpPad11.xhtml" out="${tmp}/${properName}/tozip/content.xml"
style="${xsl}/xhtml2hdoc.xsl"/>
</target>
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<div>
<xsl:apply-templates select="node()[not(preceding::h1)] | h1"/>
</div>
</xsl:template>
<xsl:template match="h1">
<xsl:variable name="numberh1" select="count(preceding-sibling::h1) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h1) = $numberh1 and not(self::h1)]"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<div>
<xsl:apply-templates select="node()[not(preceding::section) and not(preceding::h2)] | h2 | section"/>
</div>
</xsl:template>
<xsl:template match="section">
<section>
<xsl:apply-templates select="node()[not(preceding-sibling::h2)] | h2"/>
</section>
</xsl:template>
<xsl:template match="h2">
<xsl:variable name="numberh2" select="count(preceding-sibling::h2) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h2) = $numberh2 and not(self::h2)]"/>
</section>
</xsl:template>
<xsl:template match="h2[not(parent::section)]" priority="1">
<xsl:variable name="numberh2out" select="count(preceding-sibling::h2) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h2) = $numberh2out and not(self::h2) and not(self::section)]"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<div>
<xsl:apply-templates select="node()[not(preceding::section) and not(preceding::h3)] | h3 | section"/>
</div>
</xsl:template>
<xsl:template match="section">
<section>
<xsl:apply-templates select="node()[not(preceding-sibling::h3)] | h3"/>
</section>
</xsl:template>
<xsl:template match="h3">
<xsl:variable name="numberh3" select="count(preceding-sibling::h3) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h3) = $numberh3 and not(self::h3)]"/>
</section>
</xsl:template>
<xsl:template match="h3[not(parent::section)]" priority="1">
<xsl:variable name="numberh3out" select="count(preceding-sibling::h3) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h3) = $numberh3out and not(self::h3) and not(self::section)]"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<div>
<xsl:apply-templates select="node()[not(preceding::section) and not(preceding::h4)] | h4 | section"/>
</div>
</xsl:template>
<xsl:template match="section">
<section>
<xsl:apply-templates select="node()[not(preceding-sibling::h4)] | h4"/>
</section>
</xsl:template>
<xsl:template match="h4">
<xsl:variable name="numberh4" select="count(preceding-sibling::h4) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h4) = $numberh4 and not(self::h4)]"/>
</section>
</xsl:template>
<xsl:template match="h4[not(parent::section)]" priority="1">
<xsl:variable name="numberh4out" select="count(preceding-sibling::h4) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h4) = $numberh4out and not(self::h4) and not(self::section)]"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<div>
<xsl:apply-templates select="node()[not(preceding::section) and not(preceding::h5)] | h5 | section"/>
</div>
</xsl:template>
<xsl:template match="section">
<section>
<xsl:apply-templates select="node()[not(preceding-sibling::h5)] | h5"/>
</section>
</xsl:template>
<xsl:template match="h5">
<xsl:variable name="numberh5" select="count(preceding-sibling::h5) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h5) = $numberh5 and not(self::h5)]"/>
</section>
</xsl:template>
<xsl:template match="h5[not(parent::section)]" priority="1">
<xsl:variable name="numberh5out" select="count(preceding-sibling::h5) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h5) = $numberh5out and not(self::h5) and not(self::section)]"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<div>
<xsl:apply-templates select="node()[not(preceding::section) and not(preceding::h6)] | h6 | section"/>
</div>
</xsl:template>
<xsl:template match="section">
<section>
<xsl:apply-templates select="node()[not(preceding-sibling::h6)] | h6"/>
</section>
</xsl:template>
<xsl:template match="h6">
<xsl:variable name="numberh6" select="count(preceding-sibling::h6) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h6) = $numberh6 and not(self::h6)]"/>
</section>
</xsl:template>
<xsl:template match="h6[not(parent::section)]" priority="1">
<xsl:variable name="numberh6out" select="count(preceding-sibling::h6) + 1"/>
<section>
<header>
<h1><xsl:value-of select="."/></h1>
</header>
<xsl:apply-templates select="following-sibling::node()[count(preceding-sibling::h6) = $numberh6out and not(self::h6) and not(self::section)]"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html/body/div">
<xsl:if test="count(node()[not(self::section) and not(preceding::section) and not(self::text())]) &gt; 0">
<div>
<xsl:apply-templates select="node()[not(self::section) and not(preceding::section)]"/>
</div>
</xsl:if>
<xsl:apply-templates select="section"/>
</xsl:template>
<xsl:template match="section">
<section>
<xsl:apply-templates select="header"/>
<xsl:if test="count(child::node()[not(self::text()) and not(self::header) and not(self::section)]) &gt; 0">
<div>
<xsl:apply-templates select="child::node()[not(self::text()) and not(self::header) and not(self::section)]"/>
</div>
</xsl:if>
<xsl:apply-templates select="section"/>
</section>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -17,13 +17,13 @@
<header>
<h1>Contenu</h1>
</header>
<xsl:apply-templates select="/html/body/div"/>
<xsl:apply-templates select="/html/body/*"/>
</section>
</body>
</html>
</xsl:template>
<xsl:template match="li" priority = "2">
<xsl:template match="li[not(child::ul) and not(child::ol)]" priority = "2">
<li><p><xsl:apply-templates select="@* | node()"/></p></li>
</xsl:template>
......
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