Running Saxon XSLT transformations from Ant
It is possible to run a Saxon transformation from Ant using the standard
by using the
trax processor and with an appropriate
classpath that forces
Saxon to be selected. However, this doesn't provide the ability to take advantage of the full range
of capabilities offered by XSLT 2.0 in general and Saxon in particular (for example, schema aware
processing and multiple output files). Saxon 8.9 therefore
includes the first early release of a custom Ant task for Saxon.
The is available in
saxon8-ant.jar, under the class name
At this early stage it differs little from the standard
classpath attributes have no effect.
There is a new boolean attribute
schemaaware indicating whether the
transformation should be schema-aware.
There is a new attribute
validation allowing the values strict, lax, or skip.
The schema itself must be specified either in the stylesheet (using
or in the source document (using
<target name="release-userdoc" description="Generate User Documentation">
<param name="destination" expression="offline"/>
The above example was used to generate this documentation. With multiple output files, a single
document is specified for the principal output (which may be a dummy), and all other output files are
written in relative locations with respect to this.