-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-ODF.xml
82 lines (68 loc) · 2.54 KB
/
build-ODF.xml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>
<!--
Apache Ant build file to validate ODF (version 1.2) using Schematron.
The main target is wordqa, which cues this pipeline:
1. ODF Schematron -> SVRL
2. SVRL -> errs2xsl -> XSL
3. ODF -> (2) -> annotated ODF.
Author: Andrew Sales
Date: 20140325
Revision: 0.1
Comments:
-->
<project basedir="." default="wordqa" name="ANTProject">
<import file="build-compile-schematron.xml"/>
<!-- XML file of properties determining or describing local
configuration. -->
<property
name="properties.local.xml"
location="${basedir}/properties.local.xml"/>
<property
file="${properties.local.xml}"/>
<!-- File of properties determining or describing system configuration. -->
<property name="properties.xml"
value="${basedir}/properties.xml"/>
<property file="${properties.xml}"/>
<property name="errs2xsl" location="${xsl.dir}/errs2xsl-ODF.xsl"/>
<property name="force" value="true"/>
<target name="wordqa">
<fail unless="wordml.file" message='property $wordml.file must be specified'/>
<echo message="WordML input: ${wordml.file}"/>
<!-- first compile the Schematron schema -->
<echo message="compiling Schematron schema ${schema}"></echo>
<antcall target="compile.schematron" inheritrefs="true"/>
<!-- 1. ODF Schematron -> SVRL -->
<antcall target="wordml.schematron"/>
<!-- 2. SVRL -> errs2xsl -> XSL -->
<antcall target="svrl2xslt"/>
<!-- 3. ODF -> (2) -> annotated ODF. -->
<antcall target="annotate.wordml"/>
</target>
<target name="wordml.schematron" description="runs Schematron over ODF input to generate SVRL output">
<basename suffix=".xml" property="wordml.basename" file="${wordml.file}"/>
<xslt
in="${wordml.file}"
out="${wordml.basename}.svrl"
style="${schema.compiled}"
classpath="${saxon.classpath}"
force="${force}"/>
</target>
<target name="svrl2xslt" description="transforms SVRL to annotation XSLT">
<basename suffix=".xml" property="wordml.basename" file="${wordml.file}"/>
<xslt
out="${wordml.file}.xsl"
in="${wordml.basename}.svrl"
style="${errs2xsl}"
classpath="${saxon.classpath}"
force="${force}"/>
</target>
<target name="annotate.wordml" description="annotates ODF source with Schematron error messages">
<basename suffix=".xml" property="wordml.basename" file="${wordml.file}"/>
<xslt
out="${wordml.basename}-ANNOTATED.xml"
in="${wordml.file}"
style="${wordml.file}.xsl"
classpath="${saxon.classpath}"
force="${force}"/>
</target>
</project>