find_content.xsl 1.94 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
Drain's avatar
Drain committed
2
3
4
5
6
<!--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"/>-->
8
	<xsl:param name="DocumentType" required="yes" as="xs:string"/>
Drain's avatar
Drain committed
9
10
11
12
13
14
    <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"/>
15
                <copy file="output/.wspmeta" todir="result"/>
Drain's avatar
Drain committed
16
17
18
19
20
21
22
23
24
25
26
27
                <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-->
28
        <xslt in="hdoc/{$path}" out="get_ressources.ant" style="xsl/find_ressources.xsl"/>
Drain's avatar
Drain committed
29
30
31
        <chmod file="get_ressources.ant" perm="777"/>
        <ant antfile="get_ressources.ant"/>
        <!--the ANT runs the main XSLT transfo-->
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
		<xsl:choose>
			<xsl:when test="$DocumentType='paper'">
				<xslt in="hdoc/{$path}" out="result/content.paper" style="xsl/transfo.xsl" classpath="lib/saxon9he.jar">
					<factory name="net.sf.saxon.TransformerFactoryImpl"/>
				</xslt>
			</xsl:when>
			<xsl:when test="$DocumentType='slideshow'">
				<xslt in="hdoc/{$path}" out="result/content.slideshow" style="xsl/transfo2.xsl" classpath="lib/saxon9he.jar">
					<factory name="net.sf.saxon.TransformerFactoryImpl"/>
				</xslt>
			</xsl:when>
			<xsl:otherwise>
				<xsl:message> Wrong document type </xsl:message>
			</xsl:otherwise>
		</xsl:choose>
Drain's avatar
Drain committed
47
48
    </xsl:template>
</xsl:stylesheet>