Commit f37db780 authored by Jean Vintache's avatar Jean Vintache

cleaner insertion of namespace into container

parent 6c10dfff
......@@ -30,10 +30,8 @@
<!-- Apply Xslt -->
<target name="apply-xslt">
<!-- <replaceregexp file="${in}/pad.html" match="&lt;br&gt;" replace="&lt;br /&gt;" flags="g" /> -->
<htmlcleaner src="${in}/pad.html" dest="${tmp}/aaaa.xml"/>
<xslt classpath="lib\saxon9he.jar" in="${xsl}/html2xhtml.xsl" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" />
<htmlcleaner src="${in}/pad.html" dest="${tmp}/pad-clean.xml"/>
<xslt in="${xsl}/html2xhtml.xsl" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" />
<xslt in="${tmp}/tmpPad.xhtml" out="${tmp}/tozip/content.xml" style="${xsl}/xhtml2hdoc.xsl" />
</target>
......@@ -44,13 +42,14 @@
<!-- container -->
<touch file="${tmp}/tozip/META-INF/container.xml" />
<echo file="${tmp}/tozip/META-INF/container.xml">
&lt;container xmlns="urn:utc.fr:ics:hdoc:container" version="1.0"&gt;
&lt;rootfiles&gt;
&lt;rootfile full-path="${rootfilename}" media-type="text/xml" /&gt;
&lt;/rootfiles&gt;
&lt;/container&gt;
</echo>
<echoxml file="${tmp}/tozip/META-INF/container.xml">
<container version="1.0">
<rootfiles>
<rootfile full-path="${rootfilename}" media-type="text/xml" />
</rootfiles>
</container>
</echoxml>
<xslt classpath="lib/saxon9he.jar" in="${tmp}/tozip/META-INF/container.xml" out="${tmp}/META-INF/container.xml" style="${xsl}/addNamespaceToContainer.xsl"/>
<!-- mimetype -->
<touch file="${tmp}/mimetype" />
......@@ -74,6 +73,7 @@
<antcall target="construct_hdoc"></antcall>
<antcall target="jing-hdoc"></antcall>
<antcall target="zip"></antcall>
<antcall target="clean-tmp"></antcall>
</target>
</project>
\ 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"
xmlns="urn:utc.fr:ics:hdoc:container">
<xsl:output method="xml" indent="yes"/>
<!-- Identity transformation -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
<xsl:template match="*" priority="1">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
<xsl:template match="container" priority="2">
<xsl:processing-instruction name="oxygen">RNGSchema="http://scenari.utc.fr/hdoc/schemas/container/hdoc1-container.rng" type="xml"</xsl:processing-instruction>
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
<!-- Suppress processing-instructions -->
<xsl:template match="processing-instruction()" priority="1"/>
</xsl:stylesheet>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<xsl:strip-space elements="*"/>
<xsl:param name="text-encoding" as="xs:string" select="'utf-8'"/>
<xsl:param name="text-uri" as="xs:string" select="'../tmp/aaaa.xml'"/>
<xsl:param name="text-uri" as="xs:string" select="'../tmp/pad-clean.xml'"/>
<xsl:template name="text2xml">
<xsl:variable name="text" select="unparsed-text($text-uri, $text-encoding)"/>
......
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