|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








