You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by mk...@ra.rockwell.com on 2000/01/05 08:58:45 UTC

How to use Locator ?

Hi,

I'm writing a SAX XML parser and I need to check not only syntax (validation)
but also semantics of tags. I would like to use Locator class to get position of
tags within parsed file in order to report eventual errors but I'm rather
confused how to use it.

Who is reponsible for its implementation ??
Is the implementation a part of the xerces library or is it up to programmer to
implement the interface defined by xerces ?

Could you send me a short example of a code which would show use of Locator (as
none of the examles supplied shows that)?

Thanks a lot.

Mira




Re: How to use Locator ?

Posted by Ted Leung <tw...@sauria.com>.
If your are using the Java version of xerces,

look at the DOMAddLines sample in

xml-xerces/java/samples/dom/DOMAddLines.java

Take a look at the startElement method --  the sample saves line numbers in
the
DOM tree.

Ted
----- Original Message -----
From: <mk...@ra.rockwell.com>
To: <xe...@xml.apache.org>
Sent: Tuesday, January 04, 2000 11:58 PM
Subject: How to use Locator ?


> Hi,
>
> I'm writing a SAX XML parser and I need to check not only syntax
(validation)
> but also semantics of tags. I would like to use Locator class to get
position of
> tags within parsed file in order to report eventual errors but I'm rather
> confused how to use it.
>
> Who is reponsible for its implementation ??
> Is the implementation a part of the xerces library or is it up to
programmer to
> implement the interface defined by xerces ?
>
> Could you send me a short example of a code which would show use of
Locator (as
> none of the examles supplied shows that)?
>
> Thanks a lot.
>
> Mira
>
>
>
>