You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by chris nuernberger <cn...@gmail.com> on 2005/05/27 23:13:57 UTC

real basic SAX question

Is there a way to get the current number from the sax2 parser?  Either
from the implementation of the DefaultHandler's beginElement or
endElement callbacks or from the object that has access the the
SAX2XMLReaderImpl object?

Chris

Re: real basic SAX question

Posted by chris nuernberger <cn...@gmail.com>.
I have, and I did it exactly the way you describe!

Thanks anyway, Chris

On 6/10/05, Yotam Ofek <se...@zahav.net.il> wrote:
> chris nuernberger wrote:
> 
> >Is there a way to get the current number from the sax2 parser?  Either
> >from the implementation of the DefaultHandler's beginElement or
> >endElement callbacks or from the object that has access the the
> >SAX2XMLReaderImpl object?
> >
> >Chris
> >
> >
> >
> I don't know if you've solved this already or not, but you can just
> implement setDocumentLocator from ContentHandler, and set the Locator a
> global variable.
> Then in startElement or endElement you just query the Locator. Easy as that.
>

Re: real basic SAX question

Posted by Yotam Ofek <se...@zahav.net.il>.
chris nuernberger wrote:

>Is there a way to get the current number from the sax2 parser?  Either
>from the implementation of the DefaultHandler's beginElement or
>endElement callbacks or from the object that has access the the
>SAX2XMLReaderImpl object?
>
>Chris
>
>  
>
I don't know if you've solved this already or not, but you can just 
implement setDocumentLocator from ContentHandler, and set the Locator a 
global variable.
Then in startElement or endElement you just query the Locator. Easy as that.