[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Possible parse() overloading bug in XMLFilterImpl

  • From: Elliotte Rusty Harold <elharo@m...>
  • To: xml-dev@x...
  • Date: Wed, 8 Mar 2000 21:00:35 -0500

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.