Your observations are quite correct but I want to point out that the SAX2 code currently in Xerces is the exact code released by David Meggison, the author of SAX2 ( SAX2.0beta2 release).
Furthermore the SAX2 beta documentation seems not to be consistant about the behavior of two parser methods in XMLFilterImpl vs. the ones in XMLReader.
The statement for XMLReader is:
.... "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));" .....
While in the SAX2 documentation such a constraint does not exist for XMLFilterImpl.
I propose that this issue should be brought up to the xml-dev mailing list, since this is either a defect on the specification, a defect on the original saxbeta2 source or it is as design feature.
Thanks, Jeffrey Rodriguez IBM XML development IBM Cupertino
From: Elliotte Rusty Harold <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Possible bug in XMLFilterImpl.parse(systemId) Date: Wed, 8 Mar 2000 18:15:21 -0500
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". Either that statement is too strong or Xerces does not properly implement this method in XMLFilterImpl. In Xerces 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) in a subclass of XMLFilterImpl 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)); }
Xerces does seem to do the right thing in XMLParser so this problem only manifests itself if you're subclassing XMLFilterImpl and overriding only one of the two parse() methods.
+-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | [EMAIL PROTECTED] | 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/ | +----------------------------------+---------------------------------+
______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com