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


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: SAX2 Lexical Handler Suggestions

[ Lists Home | Date Index | Thread Index ]
  • From: Kay Michael <Michael.Kay@icl.com>
  • To: 'Chris Pratt' <chris@planetpratt.com>,David Megginson <david@megginson.com>, XML Developers List <xml-dev@xml.org>
  • Date: Thu, 13 Jul 2000 10:17:01 +0100

> 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


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

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