I have a java program that parses an XML document using xerces API.
My parsing class extends org.apache.xerces.parsers.XMLDocumentParser, overloading the startElement, endElement, characters methods.
Since it's a complicated XML document that is written by hand (mainly some kind of configuration elements), classic validation by xsd or dtd is not enough, and I have to return to the user that the XML document is not valid.
But 1 thing I could not achieve is to add the information in the error messages about the line number (and why not column number too) that is currenlty being parsed and where the error occurs.
I thing this can be possible, because Exceptions (org.apache.xerces.xni.parser.XMLParseException) generated by the parser when the XML document is not XML valid contain these informations.