From 5b5e9a7c3d1018bcfd72498445342719a55b393e Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Fri, 11 Jun 2004 15:29:27 +0000 Subject: [PATCH] Add the feature to the examples PR: 29187 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276563 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/OptionalTasks/xmlvalidate.html | 64 ++++++++++++++++++++-- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/docs/manual/OptionalTasks/xmlvalidate.html b/docs/manual/OptionalTasks/xmlvalidate.html index 3c1d95b9a..5de26528d 100644 --- a/docs/manual/OptionalTasks/xmlvalidate.html +++ b/docs/manual/OptionalTasks/xmlvalidate.html @@ -21,6 +21,7 @@ SAX1/2 parser if needed.

These can be any number of http://xml.org/sax/features/ or other features that your parser may support. +
  • <property> elements, containing string properties

    Parameters

    @@ -92,11 +93,13 @@ SAX1/2 parser if needed.

    The <xmlcatalog> element is used to perform entity resolution.

    attribute

    -

    The <attribute> element is used to set SAX Parser features. -There can be any number of attributes set, as defined here: - http://xml.org/sax/features/ -A feature essentialy changes the mode of the parser. -

    +

    The <attribute> element is used to set parser features.
    +Features usable with the xerces parser are defined here : + Setting features
    + +SAX features are defined here: + http://xml.org/sax/features/
    +

    @@ -116,6 +119,31 @@ A feature essentialy changes the mode of the parser.
    Attribute

    +

    property

    +

    The <property> element is used to set properties. +These properties are defined here for the xerces XML parser implementation : + XML Parser properties +Properties can be used to set the schema used to validate the XML file. +

    + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    nameThe name of the featureYes
    valueThe string value of the propertyYes
    +

    +

    Examples

    @@ -165,9 +193,33 @@ Scan all XML files in the project, using the catalog defined inline.
       <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>
     
    -Validate all .xml files in xml directory with the parser configured to perform schema validation. Note: The parser must support the
    http://apache.org/xml/features/validation/schema
    feature. +Validate all .xml files in xml directory with the parser configured to perform schema validation. Note: The parser must support the +
    http://apache.org/xml/features/validation/schema
    feature. + +
    +
    +
    +<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>
    +
    +
    +Validate the file xml/endpiece-noSchema.xml against the schema xml/doc.xsd.

    Copyright © 2001-2002,2004 The Apache Software Foundation. All rights