antoine 2004/06/11 08:29:27 Modified: docs/manual/OptionalTasks xmlvalidate.html Log: Add the feature <attribute name="http://xml.org/sax/features/namespaces" value="true"/> to the examples PR: 29187 Revision Changes Path 1.13 +58 -6 ant/docs/manual/OptionalTasks/xmlvalidate.html Index: xmlvalidate.html =================================================================== RCS file: /home/cvs/ant/docs/manual/OptionalTasks/xmlvalidate.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- xmlvalidate.html 24 Feb 2004 14:27:51 -0000 1.12 +++ xmlvalidate.html 11 Jun 2004 15:29:27 -0000 1.13 @@ -21,6 +21,7 @@ These can be any number of <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><tt>http://xml.org/sax/features/</tt></a> or other features that your parser may support.</li> + <li><tt><property></tt> elements, containing string properties </p> <h3>Parameters</h3> @@ -92,11 +93,13 @@ <p>The <a href="../CoreTypes/xmlcatalog.html"><tt><xmlcatalog></tt></a> element is used to perform entity resolution.</p> <h4>attribute</h4> -<p>The <tt><attribute></tt> element is used to set SAX Parser features. -There can be any number of attributes set, as defined here: - <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><tt>http://xml.org/sax/features/</tt></a> -A feature essentialy changes the mode of the parser. -</p> +<p>The <tt><attribute></tt> element is used to set parser features.<br> +Features usable with the xerces parser are defined here : + <a href="http://xml.apache.org/xerces-j/features.html">Setting features</a><br> + +SAX features are defined here: + <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><tt>http://xml.org/sax/features/</tt></a><br> + </p> <table border="1" cellpadding="2" cellspacing="0"> <tr> <td width="12%" valign="top"><b>Attribute</b></td> @@ -116,6 +119,31 @@ </table> </p> +<h4>property</h4> +<p>The <tt><property></tt> element is used to set properties. +These properties are defined here for the xerces XML parser implementation : + <a href="http://xml.apache.org/xerces-j/properties.html">XML Parser properties</a> +Properties can be used to set the schema used to validate the XML file. +</p> +<table border="1" cellpadding="2" cellspacing="0"> +<tr> + <td width="12%" valign="top"><b>Attribute</b></td> + <td width="78%" valign="top"><b>Description</b></td> + <td width="10%" valign="top"><b>Required</b></td> +</tr> + <tr> + <td valign="top">name</td> + <td valign="top">The name of the feature</td> + <td align="center" valign="top">Yes</td> + </tr> + <tr> + <td valign="top">value</td> + <td valign="top">The string value of the property</td> + <td align="center" valign="top">Yes</td> + </tr> +</table> +</p> + <h3>Examples</h3> <pre> @@ -165,9 +193,33 @@ <fileset dir="xml" includes="**/*.xml"/> <attribute name="http://xml.org/sax/features/validation" value="true"/> <attribute name="http://apache.org/xml/features/validation/schema" value="true"/> + <attribute name="http://xml.org/sax/features/namespaces" value="true"/> +</xmlvalidate> +</pre> +Validate all .xml files in xml directory with the parser configured to perform schema validation. Note: The parser must support the +<pre>http://apache.org/xml/features/validation/schema</pre> feature. + +<br> +<pre> +<!-- Converts path to URL format --> +<pathconvert dirsep="/" property="xsd.file"> +<path> + <pathelement location="xml/doc.xsd"/> +</path> +</pathconvert> + +<xmlvalidate file="xml/endpiece-noSchema.xml" lenient="false" + failonerror="true" warn="true"> + <attribute name="http://apache.org/xml/features/validation/schema" + value="true"/> + <attribute name="http://xml.org/sax/features/namespaces" value="true"/> + <property + name="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation" + value="${xsd.file}"/> </xmlvalidate> </pre> -Validate all .xml files in xml directory with the parser configured to perform schema validation. Note: The parser must support the <pre>http://apache.org/xml/features/validation/schema</pre> feature. +<br> +Validate the file xml/endpiece-noSchema.xml against the schema xml/doc.xsd. <br> <hr> <p align="center">Copyright © 2001-2002,2004 The Apache Software Foundation. All rights
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]