You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Thropp, Shawn" <th...@adlnet.org> on 2003/02/26 15:48:11 UTC

Settting Schema Locations

Xerces Community/Developers:

I've been successful in integrating the Xerces (2.01) DOMParser with Java
code in order to perform parsing of wellformedness and validation to XSDs.
My code is setup in the following manner:

1.  DOMParser object created by passing in the StandardParserConfiguration()

2.  The  "http://xml.org/sax/features/validation"  and
"http://apache.org/xml/features/validation/schema" features set to true

3.  The "http://apache.org/xml/properties/schema/external-schemaLocation"
property set to the  directory where the XSDs reside

In my attempts to upgrade to a newer Xerces jar (2.0.2, 2.1.0., 2.2.0.
2.3.0), the following error occurs when validating against the XSDs:
ERROR: schema_reference.4: Failed to read schema document '<xxx>.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>. 

My XML instance targets 3 XSDs - 2 of which contain import statements to
other XSDs. The error message's text implies that it is hollering at these 2
XSDs with import statements while the stand-alone XSD is validated just
fine.

Does anybody know why this is happening?  Could it be the way the DOMParser
is being setup or have newer versions of Xerces implemented something new
that I might be missing?

Thanks in advance,
Schawn 

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Settting Schema Locations

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
The external-schemaLocation property must be a string containing
"ns1 xsd1 ns2 xsd2 ... "
that is, pairs of (namespaceURI, XsdURI) with each URI whitespace-delimited.
I think that earlier versions of Xerces were more liberal about what they
accepted for xsdURI.

Jeff
----- Original Message -----
From: "Thropp, Shawn" <th...@adlnet.org>
To: <xe...@xml.apache.org>; <xe...@xml.apache.org>
Sent: Wednesday, February 26, 2003 6:48 AM
Subject: Settting Schema Locations


...
> In my attempts to upgrade to a newer Xerces jar (2.0.2, 2.1.0., 2.2.0.
> 2.3.0), the following error occurs when validating against the XSDs:
> ERROR: schema_reference.4: Failed to read schema document '<xxx>.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>.
>
> My XML instance targets 3 XSDs - 2 of which contain import statements to
> other XSDs. The error message's text implies that it is hollering at these
2
> XSDs with import statements while the stand-alone XSD is validated just
> fine.


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org