Hi all,
It seems like the xsi:schemaLocation takes precedence over the
http://apache.org/xml/properties/schema/external-schemaLocation
property. Is it by design? Why?
I am trying to use ANT's <xmlvalidate> task this way:
<xmlvalidate>
<fileset dir="${mySourceDirectory}" includes="${myXmlFiles}" />
<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" />
<property
name="http://apache.org/xml/properties/schema/external-schemaLocation"
value="${mySchema}" />
</xmlvalidate>
My XML files declare a schema location:
<myrootelm xsi:schemaLocation="mynamespace
http://localhost:8080/mynamespace/MySchema.xsd" ...>
The validation fails with the following log:
[xmlvalidate] mypath/MyFile.xml:1:1:
http://www.w3.org/TR/xml-schema-1#SchemaLocation?myschemapath/MySchema.xsd
[xmlvalidate] mypath/MyFile.xml:8:332: schema_reference.4: Failed to
read schema document 'http://localhost:8080/mynamespace/MySchema.xsd',
because 1) could not
find the document; 2) the document could not be read; 3) the root
element of the
document is not <xsd:schema>.
[xmlvalidate] mypath/MyFile.xml:8:332: cvc-elt.1: Cannot find the
declaration of element 'myrootelm'.
The schema is not available on the server (i.e. at
http://localhost:8080/mynamespace/MySchema.xsd) but I did not want to
validate using that schema either.
Please help,
Adrian.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]