Getting line number while traversing DOM using Xerces
I am using Xerces DOMParser to read an XML file and to load it into a DOM. The problem is that I'd like to inform users about some semantic errors in the file and to print an appropriate line number and column number that a particular Node occurs on. I have no idea how to do this.
Any suggestion?
Thanks in advance!
[336 byte] By [
force_ska] at [2007-11-26 13:26:54]

# 1
If you were using a DOMBuilder or a SAXParser, I would tell you to set an ErrorHandler on your parser. Then when it's passed a SAXParseException, you could call its getLineNumber and getColumnNumber methods.
So if this Xerces class doesn't support something like that, then maybe you should ask the question on a Xerces forum.