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

Re: SAX Locator vs {start,end}Entity


sax locator


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!

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.