Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] "Additional namespace" Exception using XMLReader

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Edwin Dankert <edankert AT gmail.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] "Additional namespace" Exception using XMLReader
  • Date: Wed, 22 Aug 2007 08:05:01 -0400

Edwin Dankert wrote:
Thanks for the quick reply, I had another good look at the code and
realize that I did something wrong.

The other simplified XML Object Model APIs all set the namespace-
awareness property on the supplied XMLReader by default and XOM
doesn't.


Um, no. That's not right. The issue is not XMLReader, which is a correctly designed API. The issue is SAXParser and SAXParserFactory, which isn't. If you stuck to XMLReader and XMLReaderFactory, this would not have happened.


Could you elaborate on this?


You just did. This class should be namespace aware by default. It was designed for the non-namespace-aware SAX 1 API. It simply does not fit well with SAX2. I've tried to get this class removed from the JDK or at least deprecated, so far without success.

I intend to use the JAXP 1.3 mechanism to validate the XML input
document, setting the Schema object on the SAXParserFactory
which can then provide me with a correctly configured SAXParser/XMLReader.

Would you suggest I use the
"http://java.sun.com/xml/jaxp/properties/schemaSource"; property
instead?


I usually use the Xerces specific properties for that.


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page