ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-dev
xml-dev
Possible parse() overloading bug in XMLFilterImpl
by Elliotte Rusty Harold other posts by this author
Mar 9 2000 2:00AM messages near this date
Bug in Public schema for datatypes, replacement publicly available | ANNOUNCE: SOAP-RPC 0.00
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@[...].edu | 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@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved