<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="schema-processing" page="validation-from-ant" subpage=""/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Running validation from Ant</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Running validation from Ant"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Running validation from Ant</h1> <p>It is possible to use the Saxon schema validator using the standard Ant tasks <code>xmlvalidate</code> and <code>schemavalidate</code>. To use Saxon rather than Xerces as the validation engine, specify the attribute <code>classname="com.saxonica.jaxp.ValidatingReader"</code>, and make sure Saxon-EE is on the classpath.</p> <p>The schema to be used for validation can be specified using the <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code> attributes in the instance document, or (in the case of the <code>schemavalidate</code> task) using the <code>schemavalidate/schema</code> child element or the <code>schemavalidate/@noNamespaceFile</code> or <code>schemavalidate/@noNamespaceURL</code> attributes.</p> <p>The attributes <code>lenient</code> and <code>fullchecking</code> have no effect.</p> <p>The child element <code>schemavalidate/attribute</code> can be used to set options. Any option defined by the constants in class <code>net.sf.saxon.FeatureKeys</code> 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.</p> <p>Properties of particular interest include the following:</p> <table> <tr> <td content="para"> <p>Name</p> </td> <td content="para"> <p>Value</p> </td> </tr> <tr> <td content="para"> <p>http://saxon.sf.net/feature/licenseFileLocation</p> </td> <td content="para"> <p>The filename where the Saxon-EE license file is found</p> </td> </tr> <tr> <td content="para"> <p>http://saxon.sf.net/feature/schemaURIResolverClass</p> </td> <td content="para"> <p>Class used to resolve URIs of schema documents</p> </td> </tr> <tr> <td content="para"> <p>http://saxon.sf.net/feature/schema-validation-mode</p> </td> <td content="para"> <p> <code>strict</code> or <code>lax</code>: determines whether validation fails if no element declaration can be found for the top-level element.</p> </td> </tr> <tr> <td content="para"> <p>http://saxon.sf.net/feature/standardErrorOutputFile</p> </td> <td content="para"> <p>Log file to capture validation errors</p> </td> </tr> <tr> <td content="para"> <p>http://saxon.sf.net/feature/xsd-version</p> </td> <td content="para"> <p> <code>1.0</code> or <code>1.1</code> depending on the version of the XML Schema (XSD) Recommendation to be supported. Default is <code>1.0</code> </p> </td> </tr> </table> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="satransformcmd.xml">Next</a></p> </td> </tr> </table> </body> </html>