Re: [xml-dev] SAX/Java Proposed Changes

Elliotte Rusty Harold <[email protected]> Tue, 9 Mar 2004 10:27:31 -0500
Newsgroups gmane.text.xml.sax.devel,gmane.text.xml.devel
Message-ID <p06010200bc72dbe230fe@[192.168.254.4]>
At 8:01 PM -0500 3/8/04, Karl Waclawek wrote:

>>  I'm not sure what this program is supposed to demonstrate. One of the
>>  conclusions I think we're reaching is that if a client supplied
>>  method such as startDocument() throws an exception, then endDocument
>>  (and fatalError()) are not called.


I thought this when this discussion started, but I've been convinced 
otherwise since then. There are just too many different exceptions a 
client can throw for too many different reasons, including not only 
SAXExceptions but many RuntimeExceptions and even errors, some of 
which (ArrayIndexOutOfBoundsException, OutOfMemoryError) may be 
unintentional and the result of program bugs.  The model is cleaner 
if the ErrorHandler is reserved for errors defined in the XML 
specification. And according to the JavDoc, this is what it does now. 
For the fatalError() method it says, "This corresponds to the 
definition of 'fatal error' in section 1.2 of the W3C XML 1.0 
Recommendation. For example, a parser would use this callback to 
report the violation of a well-formedness constraint."

It doesn't say that fatalError cannot be called for other, client 
generated exceptions, but there doesn't seem to be any text at all 
indicating that they could be.
-- 

   Elliotte Rusty Harold
   [email protected]
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml            
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA 


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
List: sax-devel, [email protected]
See:  http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel