Hi Adam,

"Adam Retter" <[EMAIL PROTECTED]> wrote on 11/10/2008 11:00:53
AM:

> Thanks for the reply Michael,
>
> Regarding the JAXP Validation API - I don't really understand how I
> can use that with XMLReader for document parsing and validation
> using SAX. Any ideas?

Start with a SAXParserFactory [1], set the Schema object on it and
namespace awareness to true. Getting the XMLReader [2] should be
straightforward from there.

> Regards Xerces, I naively assumed that the Sun JDK fork of Xerces
> would have very minor changes.

A lot of people assume that but they actually are quite different and seem
to keep moving on divergent paths.

> Subsequently I have downloaded Xerces 2.9.1 and tried this in place
> of Sun's Xerces fork, unfortunately I am still getting the same
> problem and have doubly checked that I am now using org.apache.
> xerces.* classes and not the Sun ones.
>
> Again, looking through the (real) Xerces source I see the same
> comment in Xerces XMLSchemaValidator albeit now on line 1452.
>
> // store the external schema locations. they are set when reset is
called,
> // so any other schemaLocation declaration for the same namespace will be
> // effectively ignored. becuase we choose to take first location hint
> // available for a particular namespace.

Unless you're setting the external schema location properties on the parser
the comment you found is probably a red herring.

> Thanks

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/SAXParserFactory.html
[2]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/SAXParser.html#getXMLReader()

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

Reply via email to