|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: SAX Locator vs {start,end}Entity
On Thu, 20 Feb 2003, Richard Tobin wrote: > >> Xerces seems to disagree: it returns the entity whose start or end is > >> being reported. So I guess one can't rely on it. > > >I think that is what Gregory meant. > > He said "the entity in which the reference was encountered", which I > took to mean the entity containing "&ent;", rather than the entity ent > refers to. > > Gregory, can you clarify? Here is how I have implemented the SAX 2.0 Locator interface: Entity being parsed Event Sysid reported by locator ------------------- ----------------- ------------------------ Document startElement Document Document startEntity Foo Document Foo startElement Foo Foo endElement Foo Document entEntity Foo Document At the startEntity and endEntity events, the locator also reports the line and column numbers of the entity reference in the source document. My main concern was error reporting: if an error occurs at or about an entity reference, I wanted the locator to aid in troubleshooting. If you have the locator return the system identifier of the referenced entity, what would the line and column numbers be? 0 and 0? Note though that a similar problem occurs with startDocument() and endDocument(), in that it isn't clear what are the line number and column number of such a "threshold event." // Gregory Murphy <Gregory.Murphy@s...>
|
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








