[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Possible parse() overloading bug in XMLFilterImpl
I first thought this was a bug in my parser but it's been pointed out to me that Xerces just inherited it from SAX. The SAX 2 documentation states in the API docs for XMLReader: public void parse(java.lang.String systemId) throws java.io.IOException, SAXException Parse an XML document from a system identifier (URI). This method is a shortcut for the common case of reading a document from a system identifier. It is the exact equivalent of the following: parse(new InputSource(systemId)); Notice the phrase "exact equivalent". In the XMLFilterImpl class the parse(systemId) method is defined as follows: public void parse (String systemId) throws SAXException, IOException { setupParse(); parent.parse(systemId); } The result is that overriding parse(InputSource in) does not change the behavior of parse (String systemId) so they are not exactly equivalent. What I suspect it should do is: public void parse (String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); } No similar constraint is given in the Java docs for XMLFilterImpl, which does not implement XMLReader, so maybe there's a reason for these two to behave differently. But it seems suspicious to me. Since XMLFilterImpl implements XMLFilter which extends XMLReader, I'd expect the constraints to inherit through. +-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | elharo@m... | Writer/Programmer | +-----------------------+------------------------+-------------------+ | The XML Bible (IDG Books, 1999) | | http://metalab.unc.edu/xml/books/bible/ | | http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java News: http://metalab.unc.edu/javafaq/ | | Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/ | +----------------------------------+---------------------------------+ *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|