You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Brad O'Hearne <ca...@megapathdsl.net> on 2001/03/07 18:59:35 UTC

Idea for the ErrorHandler

In the ErrorHandler class, it would be very handy to have some additional
information sent to the error, fatalError, and warning methods, such as a
reference to the element stack, the element name, and/or a byte offset in
the stream, if that is being maintained.  Take for instance the following
Exception I report from my ErrorHandler:

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x19) was
found in the element content of the document.
 at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969)
 at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocume
ntScanner.java:643)
 at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1355)
 at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:380)
 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)

It would be really nice to know what element caused this problem, and
further, which occurrence of that element caused the problem.  I actually am
maintaining my own element stack for handling purposes, and so it looks like
I will probably store a reference to this stack in my ErrorHandler class.
However, I would think this type of information would be wanted by everyone,
and hence, possibly a helpful change to the source.

BradO