OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



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

[ Lists Home | Date Index | Thread Index ]

Kirk Allen Evans wrote:

>endDocument should only be raised after exception if the rest of the
>document continues to be parsed after exception.  
><?xml version="1.0" encoding="UTF-8"?>
>   <foo/>
>   <foo>&bar;</foo>
>   <foo/>
>   <foo/>
>The entity "bar" is not declared here.  If you are parsing this document,
>how many times do you expect startElement to be invoked?  If you argue it
>raised three times, then endDocument should not be invoked because you imply
>that you reached the end of the document when you did not.  You should only
>invoke endDocument when you actually parse the end of the document.
I'll vote with Kirk, Jochen, Karl, and others on this one. From a 
principle of least surprise standpoint, I don't see the sense in 
endDocument() being called when the document has not been fully 
processed. I think it should only be called upon successful completion 
of the parse.

As for filters and handlers, they should always initialize their state 
on startDocument(). That will prevent any errors due to reuse after 
attempting to parse a bad document.

  - Dennis


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS