prepareCourseUcCopies.xsl 1.99 KB
Newer Older
Ivan D'halluin's avatar
Ivan D'halluin committed
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
  xmlns:op="utc.fr:ics/opale3"
  xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
  >
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
Decorde Jeffrey's avatar
Decorde Jeffrey committed
10
  <xsl:param name="filename"/>
Ivan D'halluin's avatar
Ivan D'halluin committed
11
12

  <xsl:template match="sc:item">
Decorde Jeffrey's avatar
Decorde Jeffrey committed
13
    <project name="copy-ucs" basedir="../.." default="main">
14
15
16
17
18
19
20
      <property name="in" location="${{basedir}}/input"/>
      <property name="out" location="${{basedir}}/output"/>
      <property name="tmp" location="${{basedir}}/tmp"/>
      <property name="xsl" location="${{basedir}}/xsl"/>
      <property name="lib" location="${{basedir}}/lib"/>
      <property name="log" location="${{basedir}}/log"/>
      <property name="schema" location="${{basedir}}/schema"/>
Decorde Jeffrey's avatar
Decorde Jeffrey committed
21
      <property name="filename" location="${$filename}"/>
Ivan D'halluin's avatar
Ivan D'halluin committed
22
23
      <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
        <classpath>
Decorde Jeffrey's avatar
Decorde Jeffrey committed
24
          <pathelement location="../${lib}/jing.jar"/>
Ivan D'halluin's avatar
Ivan D'halluin committed
25
26
27
28
29
30
31
32
33
34
35
36
37
        </classpath>
      </taskdef>

      <property file="global.properties"/>

      <target name="main">
        <xsl:apply-templates select=".//sp:courseUc"/>
      </target>
    </project>
  </xsl:template>

  <xsl:template match="sp:courseUc">
    <xslt
Decorde Jeffrey's avatar
Decorde Jeffrey committed
38
39
        in="${{tmp}}/${{filename}}/outputWithCourseUcIds.xml"
        out="${{tmp}}/${{filename}}/decompressedOpaleDivided/{@data-export-file}"
40
        style="${{xsl}}/copyCourseUc.xsl"
Ivan D'halluin's avatar
Ivan D'halluin committed
41
42
43
44
45
        processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
    >
      <param name="elementid" expression="{@data-export-id}"/>
    </xslt>

46
47
    <trycatch property="foo" reference="bar">
      <try>
Decorde Jeffrey's avatar
Decorde Jeffrey committed
48
        <jing file="${{tmp}}/${{filename}}/decompressedOpaleDivided/{@data-export-file}" rngfile="${{schema}}/op_expUc.rng"></jing>
49
50
51
52
53
      </try>
      <catch>
        <echo>Validation failed</echo>
      </catch>
    </trycatch>
Ivan D'halluin's avatar
Ivan D'halluin committed
54
55

  </xsl:template>
56
</xsl:stylesheet>