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

SAX2: always lexical ordering?

  • From: David Brownell <david-b@p...>
  • To: Michael Fuller <msf@i...>, XML-DEV <xml-dev@x...>
  • Date: Fri, 18 Feb 2000 15:54:55 -0800

lexical order
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@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/threads.html
***************************************************************************

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.