find_content.xsl 1.36 KB
Newer Older
Drain's avatar
Drain committed
1 2 3 4 5 6
<?xml version="1.0" encoding="UTF-8"?>
<!--find_content.xsl creates a ANT file get_content-->
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    xmlns:h="urn:utc.fr:ics:hdoc:container"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
7
    <!--<xsl:param name="destfile" required="yes" as="xs:string"/>-->
Drain's avatar
Drain committed
8 9 10 11 12 13
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="h:container">
        <project name="hdoc_to_optim" default="main">
            <target name="main">
                <mkdir dir="result"/>
                <chmod dir="result" perm="777"/>
14
                <copy file="output/.wspmeta" todir="result"/>
Drain's avatar
Drain committed
15 16 17 18 19 20 21 22 23 24 25 26
                <xsl:apply-templates/>
            </target>
        </project>
    </xsl:template>
    
    <xsl:template match="h:rootfiles">
        <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="h:rootfile">
        <xsl:variable name="path" select="@full-path"/>
        <!--the ANT runs the XSLT get_ressources then the ANT created by it-->
27
        <xslt in="hdoc/{$path}" out="get_ressources.ant" style="xsl/find_ressources.xsl"/>
Drain's avatar
Drain committed
28 29 30
        <chmod file="get_ressources.ant" perm="777"/>
        <ant antfile="get_ressources.ant"/>
        <!--the ANT runs the main XSLT transfo-->
31
        <xslt in="hdoc/{$path}" out="result/content.paper" style="xsl/transfo.xsl"/>
Drain's avatar
Drain committed
32 33
    </xsl:template>
</xsl:stylesheet>