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

Re: (more) extensible SAX

  • From: David Brownell <david-b@p...>
  • To: Paul Tchistopolskii <paul@q...>, Eric van der Vlist <vdv@d...>,xml-dev@l...
  • Date: Wed, 06 Dec 2000 08:53:30 +0000

buy sax in london
> > Which productions -- the lexical ones, or the grammatical ones?  I count
> > two layers there.  (Evidently from its SGML heritage, XML doesn't have
> > the cleanest of distinctions between those layers, but it exists.)  The
> > SAX API is basically a grammatical layer.
> 
> Sorry for side-effect, but why do you, people, call SAX API a 'parser' or 
> 'grammatical layer' ?

"Parser" is a word that's fuzzy around the edges, but it always
involves processing according to some grammar.  Textbooks
about things like compilers will talk about such issues.


> In the existanse of yacc and lex -  I think SAX API is a lexer. 
> It returns lexems. Tokens. 

A lexer returns tokens in order -- all of them.  You'd see "%foo;" be
reported, and never interpreted.  In no way is SAX a lexical API;
it provides syntactic interpretation ("start element" etc).

Parsing builds some higher level model out of token streams.
Something like YACC is irrelevant for XML, since the model
inherited from SGML isn't well-enough factored; you can't
use such tools, there are too many funky special cases.

For one XML example, turning "%foo;" into a stream of tokens
(that fudges some nastiness, note!) in DTDs (a context defined
by the parser) or passing it through unaltered (outside DTD)
is done inside the parser. 

It's long been known that a SAX2 extension exposing lexical
events could be defined ... but nobody's been motivated to
work on one, so far as I know, since so few applications need
to see that kind of data.

- Dave



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.