Commit c91f2ddf authored by bperraud's avatar bperraud

Import CSS in hdoc_to_pdf.ant and find_content.xsl done

parent e09fad7e
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<target name="main" depends="convertMac, convertWindows, convertUnix"> <target name="main" depends="convertMac, convertWindows, convertUnix">
<!--temporary files and folders are deleted--> <!--temporary files and folders are deleted-->
<delete dir="${tmp}"/> <!--<delete dir="${tmp}"/>
<delete file="prepare_hdoc.ant"/> <delete file="prepare_hdoc.ant"/>-->
</target> </target>
<!-- Mac target --> <!-- Mac target -->
...@@ -88,8 +88,9 @@ ...@@ -88,8 +88,9 @@
<chmod dir="${tmp}" perm="777"/> <chmod dir="${tmp}" perm="777"/>
<!--launches the XSLT find_content to retrieve the content path--> <!--launches the XSLT find_content to retrieve the content path-->
<xslt in="${tmp}/META-INF/container.xml" out="prepare_hdoc.ant" style="xsl/find_content.xsl"> <xslt in="${tmp}/META-INF/container.xml" out="prepare_hdoc.ant" classpath="./lib/saxon9he.jar" style="xsl/find_content.xsl">
<param name="TempRepository" expression="${tmp}"/> <param name="BaseDirectory" expression="${basedir}"/>
<param name="TempDirectory" expression="${tmp}"/>
</xslt> </xslt>
<chmod file="prepare_hdoc.ant" perm="777"/> <chmod file="prepare_hdoc.ant" perm="777"/>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--find_content.xsl creates a ANT file prepare_hdoc.ant--> <!--find_content.xsl creates a ANT file prepare_hdoc.ant-->
<xsl:stylesheet <xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:h="urn:utc.fr:ics:hdoc:container" xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema"> xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:param name="TempRepository" required="yes" as="xs:string"/>
<xsl:param name="BaseDirectory" required="yes" as="xs:string"/>
<xsl:param name="TempDirectory" required="yes" as="xs:string"/>
<xsl:output method="xml" indent="yes"/> <xsl:output method="xml" indent="yes"/>
<xsl:template match="h:container"> <xsl:template match="h:container">
<project name="hdoc_to_pdf" default="main"> <project name="hdoc_to_pdf" basedir=".." default="main">
<target name="main"> <target name="main">
<xsl:apply-templates/> <xsl:apply-templates/>
</target> </target>
</project> </project>
</xsl:template> </xsl:template>
<xsl:template match="h:rootfiles"> <xsl:template match="h:rootfiles">
<xsl:apply-templates/> <xsl:apply-templates/>
</xsl:template> </xsl:template>
<xsl:template match="h:rootfile"> <xsl:template match="h:rootfile">
<xsl:variable name="path" select="@full-path"/> <xsl:variable name="path" select="@full-path"/>
<xslt in="{$TempRepository}/{$path}" out="{$TempRepository}/hdoc_nsless.xhtml" style="xsl/ns_remover.xsl"/> <xsl:analyze-string select="$path" regex="\.?[-_0-9a-zA-Z]+(\.[-_0-9a-zA-Z]+)?$">
<xslt in="{$TempRepository}/hdoc_nsless.xhtml" out="{$TempRepository}/flat_hdoc.xhtml" style="xsl/hdoc_flattenizer.xsl"/> <xsl:matching-substring>
<xslt in="{$TempRepository}/flat_hdoc.xhtml" out="{$TempRepository}/final.xhtml" style="xsl/last_transformer.xsl"/> <echo message="MATCHING TEST :"/>
<echo>
<xsl:attribute name="message"><xsl:value-of select="."/></xsl:attribute>
</echo>
<xsl:variable name="filename">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:variable name="dirpath" select="concat($TempDirectory, '/', substring($path, 1, string-length($path) - string-length($filename) - 1))"/>
<echo message="Path : {$path}"/>
<echo message="Filename : {$filename}"/>
<echo message="Dirpath : {$dirpath}"/>
<copy file="{$BaseDirectory}/css/main.css" tofile="{$dirpath}/main.css"/>
<xslt in="{$TempDirectory}/{$path}" out="{$TempDirectory}/hdoc_nsless.xhtml" style="xsl/ns_remover.xsl" classpath="./lib/saxon9he.jar"/>
<xslt in="{$TempDirectory}/hdoc_nsless.xhtml" out="{$TempDirectory}/flat_hdoc.xhtml" style="xsl/hdoc_flattenizer.xsl" classpath="./lib/saxon9he.jar"/>
<xslt in="{$TempDirectory}/flat_hdoc.xhtml" out="{$TempDirectory}/final.xhtml" style="xsl/last_transformer.xsl" classpath="./lib/saxon9he.jar"/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:template> </xsl:template>
</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