Running Validation from Ant
It is possible to use the Saxon schema validator using the standard Ant tasks
xmlvalidate and schemavalidate. To use Saxon rather than
Xerces as the validation engine, specify the attribute
classname="com.saxonica.ee.jaxp.ValidatingReader", and make sure Saxon-EE
is on the classpath.
The schema to be used for validation can be specified using the
xsi:schemaLocation and xsi:noNamespaceSchemaLocation
attributes in the instance document, or (in the case of the schemavalidate
task) using the schemavalidate/schema child element or the
schemavalidate/@noNamespaceFile or
schemavalidate/@noNamespaceURL attributes.
The attributes lenient and fullchecking have no effect.
The child element schemavalidate/attribute can be used to set options. Any
option defined by the constants in class net.sf.saxon.lib.Feature can be specified,
provided the required value is expressible as a string (for boolean values, use "true" and
"false"). Saxon also recognizes some property names defined by the Apache Xerces product,
for compatibility.
Properties of particular interest include the following:
|
Name |
Value |
|
http://saxon.sf.net/feature/licenseFileLocation |
The filename where the Saxon-EE license file is found. |
|
http://saxon.sf.net/feature/schemaURIResolverClass |
Class used to resolve URIs of schema documents. |
|
http://saxon.sf.net/feature/schema-validation-mode |
|
|
http://saxon.sf.net/feature/standardErrorOutputFile |
Log file to capture validation errors. |
|
http://saxon.sf.net/feature/xsd-version |
|