transformation0.xsl 2.09 KB
Newer Older
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:c="urn:utc.fr:ics:hdoc:container"
    >
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

    <xsl:template match="c:container">
        <project name="getContentFileAndTransformIt" basedir="." default="start">
            <property file="global.properties"/>

            <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
                <classpath>
                    <pathelement location="../lib/jing.jar"/>
                </classpath>
            </taskdef>

            <xsl:apply-templates select="./c:rootfiles"/>
        </project>
    </xsl:template>

    <xsl:template match="c:rootfiles">
        <target name="start">
            <jing file="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}" rngfile="${{schema}}/hdoc1-xhtml.rng"></jing>

            <xslt
                in="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}"
                out="${{tmp}}/moveRessourceFiles.xml"
                style="${{xsl}}/moveRessourceFiles.xsl"
                processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
            />
            <chmod file="${{tmp}}/moveRessourceFiles.xml" perm="777"/>
            <xslt
                in="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}"
                out="${{tmp}}/decompressedOpale/main.xml"
                style="${{xsl}}/transformation2.xsl"
                processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
            />
            <chmod file="${{tmp}}/decompressedOpale/main.xml" perm="777"/>

            <!-- Finding references and converting them -->
            <xslt
                in="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}"
                out="${{tmp}}/convertReferences.xml"
                style="${{xsl}}/prepareReferencesConversions.xsl"
                processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
            />
            <ant antfile="${{tmp}}/convertReferences.xml"/>
        </target>
    </xsl:template>
</xsl:stylesheet>