forked from heremaps/com.here.validate.svrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-svrl.xml
100 lines (96 loc) · 4.85 KB
/
run-svrl.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
<?xml version="1.0" encoding="UTF-8"?>
<!--ant-->
<!--
This file is part of the Spelling and Grammar Checker project.
See the accompanying LICENSE file for applicable licenses.
-->
<project default="run-svrl" name="com.here.validate.svrl.xslt">
<!--
Ant target to allow direct invocation of the valiadator transforms, this means we can use an alternative classpath.
-->
<target name="run-svrl">
<xmlcatalog id="dita.catalog">
<catalogpath path="${dita.plugin.org.dita.base.dir}/catalog-dita.xml"/>
</xmlcatalog>
<path id="dost.class.path">
<pathelement location="${dita.plugin.com.here.validate.svrl.dir}/lib/saxon-9.1.0.8.jar"/>
</path>
<!--
Apply the XSLT defined over the root ditamap This create SVRL files from the *.ditamap and fires the associated Validator ruleset.
-->
<xslt classpathref="dost.class.path" destdir="${dita.temp.dir}/svrl/ditamap" extension=".svrl.xml" style="${svrl.customization.dir}/ditamap2svrl.xsl" useImplicitFileset="false">
<xmlcatalog refid="dita.catalog"/>
<factory name="net.sf.saxon.TransformerFactoryImpl">
<!--
Setting several options of Saxon XSLT engine to enable some additional functionality,
see for more details:
http://www.saxonica.com/html/documentation/configuration/config-features.html
-->
<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
<!-- Enable keeping track of line numbers whilst transforming -->
<attribute name="http://saxon.sf.net/feature/linenumbering" value="true"/>
<attribute name="http://saxon.sf.net/feature/sourceParserClass" value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
<!-- Enable DTD validation whilst transforming -->
<attribute name="http://saxon.sf.net/feature/validation" value="false"/>
</factory>
<!-- Common parameters for the schematron template from the base plug-in -->
<param expression="${args.validate.ignore.rules}" name="IGNORE_RULES"/>
<param expression="${com.here.validate.svrl.output.rule-id}" name="OUTPUT_RULE-ID"/>
<param expression="${dita.temp.dir}/dita" name="SOURCE"/>
<param expression="${default.language}" if="default.language" name="defaultLanguage"/>
<param expression="${ruleset.fatal}" name="FATAL_RULESET"/>
<param expression="${ruleset.error}" name="ERROR_RULESET"/>
<param expression="${ruleset.warning}" name="WARNING_RULESET"/>
<param expression="ditamap" name="PATTERN_ROLE"/>
<fileset dir="${dita.temp.dir}/dita">
<include name="**/*.ditamap"/>
</fileset>
</xslt>
<!--
Apply the XSLT defined in the ${args.input.dir} directory. This create SVRL files from the *.dita and fires the Validator ruleset.
For efficiency, run XSLT Validation against modified files only, if requested.
-->
<xslt
classpathref="dost.class.path"
destdir="${dita.temp.dir}/svrl/dita"
extension=".svrl.xml"
failOnError="false"
failOnNoResources="false"
style="${svrl.customization.dir}/dita2svrl.xsl"
useImplicitFileset="false"
>
<xmlcatalog refid="dita.catalog"/>
<factory name="net.sf.saxon.TransformerFactoryImpl">
<!--
Setting several options of Saxon XSLT engine to enable some additional functionality,
see for more details:
http://www.saxonica.com/html/documentation/configuration/config-features.html
-->
<attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>
<!-- Enable keeping track of line numbers whilst transforming -->
<attribute name="http://saxon.sf.net/feature/linenumbering" value="true"/>
<attribute name="http://saxon.sf.net/feature/sourceParserClass" value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
<!-- Enable DTD validation whilst transforming -->
<attribute name="http://saxon.sf.net/feature/validation" value="false"/>
</factory>
<!-- Parameters for the textual-rules template from the base plug-in -->
<param expression="${args.validate.blacklist}" name="BLACKLIST"/>
<param expression="${args.validate.check.case}" name="CHECK_CASE"/>
<!-- Common parameters for the schematron template from the base plug-in -->
<param expression="${args.validate.ignore.rules}" name="IGNORE_RULES"/>
<param expression="${com.here.validate.svrl.output.rule-id}" name="OUTPUT_RULE-ID"/>
<param expression="${dita.temp.dir}/dita" name="SOURCE"/>
<param expression="${default.language}" if="default.language" name="defaultLanguage"/>
<param expression="${ruleset.fatal}" name="FATAL_RULESET"/>
<param expression="${ruleset.error}" name="ERROR_RULESET"/>
<param expression="${ruleset.warning}" name="WARNING_RULESET"/>
<param expression="dita" name="PATTERN_ROLE"/>
<fileset dir="${dita.temp.dir}/dita">
<include name="**/*.dita"/>
<modified update="true">
<param name="cache.cachefile" value="${args.validate.cachefile}"/>
</modified>
</fileset>
</xslt>
</target>
</project>