find_content.xsl 1.34 KB
Newer Older
Drain's avatar
Drain committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?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">
    <xsl:param name="destfile" required="yes" as="xs:string"/>
    <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"/>
                <copy file=".wspmeta" todir="result"/>
                <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-->
        <xslt in="hdoc/{$path}" out="get_ressources.ant" style="find_ressources.xsl"/>
        <chmod file="get_ressources.ant" perm="777"/>
        <ant antfile="get_ressources.ant"/>
        <!--the ANT runs the main XSLT transfo-->
        <xslt in="hdoc/{$path}" out="result/content.paper" style="transfo.xsl"/>
    </xsl:template>
</xsl:stylesheet>