Unfortunately the Locator support is not implemented yet. It is our
responsibility to give you a pointer to an object which implements the
Locator interface, which you then use during the parse to get location
information. But we've not yet done this. You can get this information
yourself via non-SAX stuff if you really need to. The getScanner() method
will return you a reference to the underlying XMLScanner object, which has
APIs to get all the position info you need.

You should think of this though as an interrim mechanism, since you'd want
to use the SAX mechanism once we get it into place. So abstract your use of
the scanner so that its pretty easily changed in the future.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



[EMAIL PROTECTED]@ra.rockwell.com on 01/04/2000 11:58:45 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
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






Reply via email to