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

RE: SAX2 Lexical Handler Suggestions

  • From: Kay Michael <Michael.Kay@i...>
  • To: 'Chris Pratt' <chris@p...>,David Megginson <david@m...>, XML Developers List <xml-dev@x...>
  • Date: Thu, 13 Jul 2000 10:17:01 +0100

RE: SAX2 Lexical Handler Suggestions
> If it is inconceivable that someone would want to parse 
> entity boundaries,
> why are there startEntity() and endEntity() method in the 
> LexicalHandler?
> Obviously a number of people have found it useful to be 
> notified when an
> Entity boundary is encountered, true?  What is the harm in 
> adding an extra
> parameter to the callback that would identify whether the 
> entity boundary
> was located in element content or an attribute value?
> 
It's entirely pragmatic: the SAX design decided, for usability reasons, to
depart from the event-notification model and supply the values of all
attributes on the startElement call. If you wanted to notify entity
boundaries in attributes, you'd have to start by notifying attributes as
events. No harm in doing that as an extension if you feel like it.

I had a project here that was asking me for the same facilities. When I
looked at the design, they'd got it all wrong. They'd got into this rathole
of trying to preserve entity references through a transformation when there
was no real need to do so, and the way they were trying to do it was buggy.

A general rule: if your application needs to know where the entity
references are, then you are not using entities the way they were designed
to be used.

Mike Kay

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.