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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   SAX2: always lexical ordering?

[ Lists Home | Date Index | Thread Index ]
  • From: David Brownell <david-b@pacbell.net>
  • To: Michael Fuller <msf@io.mds.rmit.edu.au>, XML-DEV <xml-dev@xml.org>
  • Date: Fri, 18 Feb 2000 15:54:55 -0800

E-mail troubles have lost any responses to this issue.

Briefly, of the three orders I list below, does anyone have a good
reason that SAX2 shouldn't specify lexical ordering for all its events?

I can think of two that I'm not quite sure of.  First, XML itself has
some rules about things that must be declared before use, and they might
show up here.  Second, it's a lot of work to ensure that's exactly how
it's done, and I'm not sure I see a compelling reason to expect any order
other than lexical ... so my question is:  Lexical order, or no order? 

- Dave



David Brownell wrote:
> 
> Michael Fuller wrote:
> >
> > Anyway, nothing complex: just an itemization of events, order, and meaning.
> > Less of a White Paper, more of a Memo. :-)
> > (If I get a chance, I'll whip up a draft.)
> 
> If you're also implementing these ... I'm wondering your thoughts
> about the DeclHandler.  I now see three separate parse orders
> (other implementations may see more).  Using this simple document
> 
>         <!DOCTYPE foo [
>         <?pi precedes related element?>
>         <!ELEMENT foo EMPTY>
>         <!-- comment follows -->
>         ] <foo/>
> 
> Those three orders would be
> 
>         - Lexical order.  (My SAX2 wrapper of Sun's TR2 parser.)
> 
>           setDocumentLocator (l)
>           startDocument ()
>             startDTD ("foo", null, null);
>               processingInstruction ("pi", "precedes related element")
>               elementDecl ("foo", "EMPTY")
>               comment ("comment follows" in buf/off/len format)
>             endDtd
>             startElement ("foo", null)  /* null, empty, whatever */
>             endElement ("foo")
>           endDocument ()
> 
>         - DOM order.  (My DOM parser, showing all DOM can show)
> 
>           // locator is nonsensical, not provide
>           startDocument ()
>             startDTD ("foo", null, null);
>               // PIs in DTD are discarded
>               // element/attribute data type info in DTD is discarded
>               // comments in DTD are discarded
>             endDtd
>             startElement ("foo", null)  // null, empty, whatever
>             endElement ("foo")
>           endDocument ()
> 
>         - AElfred order.  (My SAX2 enhanced version.)
> 
>           setDocumentLocator (l)
>           startDocument ()
>             startDTD ("foo", null, null);
>               processingInstruction ("pi", "precedes related element")
>               comment ("comment follows" in buf/off/len format)
>               elementDecl ("foo", "EMPTY")
>             endDtd
>             startElement ("foo", null)  /* null, empty, whatever */
>             endElement ("foo")
>           endDocument ()
> 
> I'd propose that the lexical order be the order that all SAX2 processors
> must follow.
> 
> Should it be legal for a parser to support the decl handler without also
> implementing the lexical handler?  I'd think the answer should be yes, but
> then one declaration ("root element is ...") wouldn't be available.
> 
> - 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