-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuildSchema.xml
83 lines (70 loc) · 4.03 KB
/
buildSchema.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
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="all" name="Build ODD file and schema">
<description>
This build process creates the RNG schema from the ODD file, and
also generates the documentation in HTML format.
</description>
<property name="echo.separator" value="************************************************"/>
<!-- note: following properties are passed as parameters via Oxygen:
-${pd}: current project directory (i.e. where the breezemap.xpr file lives)
-${teiPlugin}: Location of the TEI plugin framework.
-->
<import file="${teiPlugin}/xml/tei/stylesheet/common/teianttasks.xml"/>
<property name="odd2oddxsl" value="${teiPlugin}/xml/tei/stylesheet/odds/odd2odd.xsl"/>
<target name="ODDToSchema">
<echo>${echo.separator}</echo>
<echo>*Create schema from ODD file.*</echo>
<echo>${echo.separator}</echo>
<xslt force="yes" style="${teiPlugin}/xml/tei/stylesheet/odds/odd2odd.xsl" in="${basedir}/schemas/breezemap.odd" out="${basedir}/schemas/breezemap.odd.processedodd">
<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="defaultSource" expression="${defaultSource}" if="defaultSource"/>
<param name="selectedSchema" expression="${selectedSchema}" if="selectedSchema"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<buildgeneric type="relaxng" xsl="${teiPlugin}/xml/tei/stylesheet/profiles/tei/rng/to.xsl" in="${basedir}/schemas/breezemap.odd.processedodd" out="${basedir}/schemas/breezemap.rng"/>
</target>
<target name="ODDToDocumentation">
<echo>${echo.separator}</echo>
<echo>*Create documentation from ODD file.*</echo>
<echo>${echo.separator}</echo>
<xslt force="yes" style="${teiPlugin}/xml/tei/stylesheet/odds/odd2lite.xsl" in="${basedir}/schemas/breezemap.odd.processedodd" out="${basedir}/schemas/breezemap.lite.odd">
<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="defaultSource" expression="${defaultSource}" if="defaultSource"/>
<param name="selectedSchema" expression="${selectedSchema}" if="selectedSchema"/>
<param name="verbose" expression="${verbose}" if="verbose"/>
</xslt>
<!--<xslt force="yes" style="${teiPlugin}/xml/tei/stylesheet/profiles/tei/html5/to.xsl" in="${basedir}/schemas/breezemap.lite.odd" out="${basedir}/documentation/breezemap.html">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
</factory>
<param name="doctypeSystem" expression="''" type="XPATH_STRING"/>
</xslt>-->
<buildgeneric type="relaxng" xsl="${teiPlugin}/xml/tei/stylesheet/profiles/tei/html5/to.xsl" in="${basedir}/schemas/breezemap.lite.odd" out="${basedir}/documentation/breezemap.html">
</buildgeneric>
<!-- The result from the above transformation is horribly invalid. We do some tweaks using XSLT. -->
<xslt force="yes" style="${basedir}/xsl/spiff_up_documentation.xsl" in="${basedir}/documentation/breezemap.html" out="${basedir}/documentation/breezemap.html_temp">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<move file="${basedir}/documentation/breezemap.html_temp" tofile="${basedir}/documentation/breezemap.html"/>
</target>
<target name="clean">
<echo>${echo.separator}</echo>
<echo>*Clean up temp files.*</echo>
<echo>${echo.separator}</echo>
<delete dir="${basedir}/schema">
<include name="*.lite.odd"/>
<include name="*.processedodd"/>
</delete>
</target>
<target name="all">
<antcall target="ODDToSchema"/>
<antcall target="ODDToDocumentation"/>
<antcall target="clean"/>
</target>
</project>