Configuration when running Ant

It is possible to run XSLT transformations from Ant using the xslt task, selecting Saxon as the XSLT processor by setting the factory child element to the Saxon implementation class of javax.xml.transform.TransformerFactory; that is one of net.sf.saxon.TransformerFactoryImpl, com.saxonica.config.ProfessionalTransformerFactory, or com.saxonica.config.EnterpriseTransformerFactory depending on the Saxon edition in use.

Additional configuration options can be specified using the attribute child of the factory element, for example the following task was used as part of the pipeline for publishing this documentation:

<xslt in="${userdoc.dir}/src/function-data.xml" style="${userdoc.dir}/style/preprocess-functions.xsl" out="${userdoc.dir}/src/functions.xml" classpath="e:/saxon/eej/saxon9ee.jar;e:/saxon/eej/saxon-licenses"> <factory name="com.saxonica.config.EnterpriseTransformerFactory"> <attribute name="http://saxon.sf.net/feature/xsltSchemaAware" value="true"/> <attribute name="http://saxon.sf.net/feature/schema-validation-mode" value="strict"/> <attribute name="http://saxon.sf.net/feature/xsd-version" value="1.1"/> </factory> </xslt>

Many of the options available as configuration parameters (for example Feature.XSLT_INITIAL_TEMPLATE) were provided explicitly with Ant in mind. The provision of these parameters makes the customized version of the Ant XSLT task provided with some earlier Saxon versions redundant, and the customized task is no longer supported.