classpathx-xml
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-xml] ContentHander errors getting to an ErrorHandler?


From: Jean_Duteau
Subject: [Classpathx-xml] ContentHander errors getting to an ErrorHandler?
Date: Fri, 19 Apr 2002 17:09:34 -0600

Hi all,

I was always under the impression that any SAXExceptions thrown by my
ContentHandlers would be caught by the parser and passed on to my ErrorHandler.
I was about to report a bug in AElfred2 because it doesn't do this.  I consulted
the O'Reilly book and found the following quote which validates the current
AElfred2 behaviour:

'when a SAX handler throws an exception, parsing stops immediately.   The
exception passes through the parser and is thrown by XMLReader.parse().'

The rest of that section of the book then hints that SAX handlers can (and
should?) use the ErrorHandler as a centralized location for error-handling.  But
how can I do that if (a) the parser doesn't passed the errors to my ErrorHandler
and (b) a ContentHandler doesn't have a natural link to the ErrorHandler to use?

Do I have to build framework code so that all of my ContentHandlers know their
ErrorHandler?  If that was the desired behaviour, it seems strange to me that a
ContentHandler couldn't automatically get told about its ErrorHandler.

Just wondering,

Jean Duteau





reply via email to

[Prev in Thread] Current Thread [Next in Thread]