Barry, Gregory P. wrote:
Hi,
Is there a way to get the current filename and line number from within
the start element callback (or any of the callbacks for that matter)
i.e. is there a global value or can this be retrieved from an attribute
method. I looked through some of the SAX examples but could not find if
filename and line number are avail from the start element callback.
Yes. You will need to override the setDocumentLocator() member function
in ContentHandler or DocumentHandler. The parser will call that
function with a Locator instance, which you need to save. When you want
information about the entity, you can call the member functions of the
Locator class using the instance the parser supplied.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]