forked from TEIC/TEI-Simple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
321 lines (311 loc) · 16.2 KB
/
build.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="all" name="makeschemas">
<!--
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Id: $Id: antbuilder.xml 12906 2014-06-04 15:59:52Z hcayless $
Copyright: 2011, TEI Consortium<
-->
<!--
make TEI Simple schema in various forms
-->
<property name="trang" value="lib/trang.jar"/>
<property name="XSL" value="/usr/share/xml/tei/stylesheet"/>
<property name="lang" value="en"/>
<property name="doclang" value="en"/>
<property name="verbose" value=""/>
<property name="inputDir" location="."/>
<dirname property="outputDir" file="TEISimplespreadsheet.xlsx"/>
<property name="tempDir" value="${outputDir}/temp-dir-for-ant"/>
<path id="classpath">
<pathelement path="${java.class.path}"/>
</path>
<taskdef name="schematron" classname="com.schematron.ant.SchematronTask" classpath="lib/ant-schematron-2010-04-14.jar"/>
<taskdef name="runjing" classpath="${jing}" classname="com.thaiopensource.relaxng.util.JingTask"/>
<target name="all" depends="convert,schemas,tests,doc,chain,cleanup"/>
<target name="convert">
<!-- Recreate temporary output directory -->
<delete dir="${tempDir}"/>
<mkdir dir="${tempDir}"/>
<echo>Unpack spreadsheet to ${tempDir}</echo>
<unzip src="TEISimplespreadsheet.xlsx" dest="${tempDir}"/>
<echo>Convert XLSX to TEI</echo>
<xslt force="yes" style="${XSL}/profiles/default/xlsx/from.xsl" in="${tempDir}/_rels/.rels" out="TEISimplespreadsheet.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="workDir" expression="file:///${tempDir}"/>
<param name="inputDir" expression="${inputDir}"/>
</xslt>
<xslt force="yes" style="generate.xsl" out="null.xml" in="TEISimplespreadsheet.xml" destdir=".">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="lang" expression="${lang}" if="lang"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
</target>
<xslt force="yes" style="${XSL}/tools/iden.xsl" in="odd/teisimple.odd" out="xsimple.odd">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
</xslt>
<target name="schemas">
<xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="odd/teisimple.odd" out="teisimple.compiled.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}" if="lang"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="odd/teisimple.odd" out="teisimple.compiled.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}" if="lang"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/odd2dtd.xsl" in="teisimple.compiled.xml" out="teisimple.dtd">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}"/>
<param name="useFixedDate" expression="true"/>
<param name="documentationLanguage" expression="${docLang}"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/odd2relax.xsl" in="teisimple.compiled.xml" out="teisimple.rng">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}"/>
<param name="useFixedDate" expression="true"/>
<param name="documentationLanguage" expression="${docLang}"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/extract-isosch.xsl" in="teisimple.compiled.xml" out="teisimple.isosch">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="useFixedDate" expression="true"/>
</xslt>
<xslt processor="trax" force="yes" style="isoschematron/iso_schematron_message_xslt2.xsl" in="teisimple.isosch" out="teisimple.isosch.xsl">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
</xslt>
<sequential>
<java jar="${trang}" failonerror="true" fork="true">
<arg value="teisimple.rng"/>
<arg value="teisimple.rnc"/>
</java>
</sequential>
<sequential>
<java jar="${trang}" failonerror="true" fork="true">
<arg value="teisimple.rng"/>
<arg value="teisimple.xsd"/>
</java>
</sequential>
<xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="tei-pm.odd" out="tei-pm.compiled.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}" if="lang"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/odd2relax.xsl" in="tei-pm.compiled.xml" out="tei-pm.rng">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}"/>
<param name="useFixedDate" expression="true"/>
<param name="documentationLanguage" expression="${docLang}"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/extract-isosch.xsl" in="tei-pm.compiled.xml" out="tei-pm.isosch">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="useFixedDate" expression="true"/>
</xslt>
</target>
<target name="doc">
<echo>XSLT generate HTML files</echo>
<xslt force="yes" style="${XSL}/odds/odd2lite.xsl" in="teisimple.compiled.xml" out="teisimple.odd.tmp">
<xmlcatalog>
<catalogpath>
<pathelement location="$catalogfile"/>
</catalogpath>
</xmlcatalog>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="lang" expression="${lang}" if="lang"/>
<param name="doclang" expression="${lang}" if="lang"/>
<param name="documentationLanguage" expression="${lang}" if="lang"/>
</xslt>
<xslt force="yes" style="${XSL}/profiles/tei/html5/to.xsl" in="teisimple.odd.tmp" out="teisimple.odd.html">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="inputDir" expression="${inputDir}/"/>
<param name="useFixedDate" expression="true"/>
<param name="autoToc" expression="false"/>
<param name="displayMode" expression="rnc"/>
</xslt>
<xslt force="yes" style="${XSL}/profiles/tei/html5/to.xsl" in="odd/teisimple.odd" out="teisimple.html">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="inputDir" expression="${inputDir}/"/>
<param name="useFixedDate" expression="true"/>
</xslt>
<xslt force="yes" style="${XSL}/odds/odd2lite.xsl" in="tei-pm.compiled.xml" out="tei-pm.odd.tmp">
<xmlcatalog>
<catalogpath>
<pathelement location="$catalogfile"/>
</catalogpath>
</xmlcatalog>
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="summaryDoc" expression="true"/>
<param name="lang" expression="${lang}" if="lang"/>
<param name="doclang" expression="${lang}" if="lang"/>
<param name="documentationLanguage" expression="${lang}" if="lang"/>
</xslt>
<xslt force="yes" style="${XSL}/profiles/tei/html5/to.xsl" in="tei-pm.odd.tmp" out="tei-pm.odd.html">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="inputDir" expression="${inputDir}/"/>
<param name="autoToc" expression="false"/>
<param name="useFixedDate" expression="true"/>
<param name="displayMode" expression="rnc"/>
</xslt>
<xslt force="yes" style="${XSL}/profiles/tei/html5/to.xsl" in="tei-pm.odd" out="tei-pm.html">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="inputDir" expression="${inputDir}/"/>
<param name="useFixedDate" expression="true"/>
</xslt>
</target>
<target name="tests">
<echo>Validate Simple ODD against tei-pm RELAX NG</echo>
<runjing file="xsimple.odd" rngfile="tei-pm.rng" failonerror="false"/>
<echo>Validate Simple ODD against tei-pm Schematron</echo>
<schematron file="xsimple.odd" queryLanguageBinding="xslt2" schema="tei-pm.isosch" failonerror="false"/>
<echo>Validate instances against RELAX NG</echo>
<runjing rngfile="teisimple.rng" file="tests/testsimple.xml"/>
<runjing rngfile="teisimple.rng" file="tests/testsimple2.xml"/>
<runjing rngfile="teisimple.rng" file="tests/testsimple3.xml"/>
<runjing rngfile="teisimple.rng" file="tests/testsimple4.xml"/>
<runjing rngfile="teisimple.rng" file="tests/testsimple5.xml"/>
<runjing rngfile="teisimple.rng" file="tests/testsimple6.xml"/>
<runjing rngfile="teisimple.rng" file="tests/A10231.xml"/>
<echo>Validate instances against Schematron</echo>
<schematron file="tests/testsimple.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<schematron file="tests/testsimple2.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<schematron file="tests/testsimple3.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<schematron file="tests/testsimple4.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<schematron file="tests/testsimple5.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<schematron file="tests/testsimple6.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<schematron file="tests/A10231.xml" queryLanguageBinding="xslt2" schema="teisimple.isosch" failonerror="true"/>
<echo>Validate an instance against DTD</echo>
<xmlvalidate failonerror="yes" file="tests/testsimple.xml"/>
<echo>Validate an instance against XSD</echo>
<schemavalidate noNamespaceFile="teisimple.xsd" file="tests/testsimple.xml"/>
</target>
<target name="chain">
<echo>Test customization of TEI Simple</echo>
<xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="tests/myteisimple.odd" out="myteisimple.compiled.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}" if="lang"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/odd2relax.xsl" in="myteisimple.compiled.xml" out="myteisimple.rng">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}"/>
<param name="useFixedDate" expression="true"/>
<param name="documentationLanguage" expression="${docLang}"/>
</xslt>
<xslt force="yes" style="${XSL}/odds/odd2odd.xsl" in="tests/myteisimple2.odd" out="myteisimple2.compiled.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}" if="lang"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<xslt processor="trax" force="yes" style="${XSL}/odds/odd2relax.xsl" in="myteisimple2.compiled.xml" out="myteisimple2.rng">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="lang" expression="${lang}"/>
<param name="useFixedDate" expression="true"/>
<param name="documentationLanguage" expression="${docLang}"/>
</xslt>
</target>
<target name="pm">
<echo>create simple XSL from PM</echo>
<xslt force="yes" style="processingModel/simpleoddtoxsl.xsl" in="odd/teisimple.odd" out="teisimple-pm.xsl">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
</xslt>
<echo>create MS XSL from PM</echo>
<xslt force="yes" style="processingModel/simpleoddtoxsl.xsl" in="teipm-ms.odd" out="teipm-ms.xsl">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
</xslt>
<!--
<xslt force="yes" style="processingModel/simpleoddtoxsl-latex.xsl" in="odd/teisimple.odd" out="teisimple-pm-latex.xsl">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
</xslt>
-->
<echo>run test files through PM</echo>
<xslt force="yes" style="teipm-ms.xsl" in="tests/testms.xml" out="tests/testms.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/testsimple.xml" out="tests/testsimple.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/testsimple2.xml" out="tests/testsimple2.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/testsimple3.xml" out="tests/testsimple3.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/testsimple4.xml" out="tests/testsimple4.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/testsimple5.xml" out="tests/testsimple5.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/testsimple6.xml" out="tests/testsimple6.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<xslt force="yes" style="teisimple-pm.xsl" in="tests/A10231.xml" out="tests/A10231.html">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<!--
<xslt force="yes" style="teisimple-pm-latex.xsl" in="tests/testsimple4.xml" out="tests/testsimple4.tex">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
-->
</target>
<target name="cleanup">
<delete dir="${tempDir}"/>
<!--
<delete file="teisimple.compiled.xml"/>
-->
<delete file="teisimple.odd.tmp"/>
<delete file="tei-pm.odd.tmp"/>
<delete file="tei-pm.compiled.xml"/>
</target>
</project>