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

Re: [Sax-devel] Re: SAX/Java Proposed Changes


java sax enddocument not called

----- Original Message ----- 
From: "Elliotte Rusty Harold" <elharo@m...>
To: "Karl Waclawek" <karl@w...>
Cc: <xml-dev@l...>; <sax-devel@l...>
Sent: Tuesday, March 09, 2004 10:27 AM


> 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. 

Or intentional exceptions based on application logic.
The XML document may be well-formed and even valid, but from the
client's point of view it could still be in error.

> 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.

Yes, I always thought that application erros should not be reported
through the error handlers. I was just not sure if maybe the docs 
allowed or favoured it.

So what is the agreement about EndDocument() now?
I am not sure I got it. Is it as simple as this:

  endDocument() must always be called once startDocument() was called,
  even after a fatal error was reported, unless XMLReader.parse() 
  returned with an exception.

Would that be it?

Karl

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.