SAXParser.getXMLReader() supposed to return unique Instance?
"Kai S. Juse" <[email protected]>
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello all,
I am playing with the PetStore 1.3.1 on BEA WLS 7.0.0.1 and ran into
trouble with XML parsing. The SAXParser retrieved from the Factory
seems to implement the getXMLReader() method in an (too me and
the Blueprint people) unexpected way. The code in PetStore does basically
that:
createParser() {
p = // get SAXParser from Factory
r = p.getXMLReader();
r.setEntityResolver(er);
return p; // NB: returning the _parser_
}
r = createParser().getXMLReader();
// use r
The Reader was expected to be configured with the EntityResolver,
since (the way I read the spec) both calls to getXMLReader should
return the same instance. BEAs implementation of SAXParser returns
new instances of a wrapper around a single instance on XMLReader,
but the EntityResolver is held in the wrapper. That causes the above
code to fail.
Do I read the spec correctly when I expect getXMLReader to return
(at most | exactly) one instance? API Doc: getXMLReader "Returns
__the__ (my emph) XMLReader that is encapsulated by the implementation
of this class."
Can someone point me to a document that invalidaes or supports my
asumption, as BEA is not convinced.
TIA
Kai Juse
-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
List: sax-devel, [email protected]
See: http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel