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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: SAX2 Event Sequence [Was: Re: SAX2: relative orderingofstartDocument

[ Lists Home | Date Index | Thread Index ]
  • From: David Brownell <david-b@pacbell.net>
  • To: Lars Marius Garshol <larsga@garshol.priv.no>
  • Date: Wed, 01 Mar 2000 14:36:49 -0800

Lars Marius Garshol wrote:
> * David Brownell
> |
> |       - It's established (yes?) that everything outside the
> |         DTDEvents will be in lexical order.  Is that also
> |         required to be true for DTD events?
> Hmmm.  ...
> Having thought about it I think I would prefer specifying the order to
> be lexical.

That's my inclination too.  But I'm not sure it'd be good to require it.

> |       - This shows only the clean "no error" case.  I think
> |         that to be complete, this needs to cover the "error"
> |         case, which is always (yes?) required to include a
> |         call to endDocument.
> Is it? (I think it should be, but I don't think it is at the moment.)

I think it is:

    The SAX parser will invoke this method only once, and it will be
    the last method invoked during the parse. The parser shall not invoke
    this method until it has either abandoned parsing (because of an
    unrecoverable error) or reached the end of input.

Re how many parsers do this correctly, I'm not sure.  My enhanced AElfred
does (now), but I think many others don't.

> And what about the case when the parser throws an exception?

See above -- a thrown exception is "an unrecoverable error".

In Java, try/finally does a fine job of letting the parser call
the endDocument() handler even in that case.

- Dave

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/threads.html


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

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