commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject [Digester] Error handler not working
Date Fri, 30 Jun 2006 19:33:31 GMT
Hello... I'm parsing some XML that I am validating against a DTD... I'd
like to be able to stop processing when that validation fails, and I
thought setErrorHandler() would do it, but seemingly not... I have a class
that implements.org.xml.sax.ErrorHandler, with three methods:

public void error(SAXParseException exception)
public void fatalError(SAXParseException exception)
public void warning(SAXParseException exception)

I register it with my Digester instance (before parsing begins) via
setErrorHandler().

I just did a simple exception.printStackTrace() (as well as some println's
to be sure) in each method, and it turns out they are not getting called. 
However, I can see in my logs a SEVERE message stating where the
validation failed from Digester, so it IS validating as expected.

Should this work this way?  Does the error handler you register via
setErrorHandler() not handle DTD validation failures maybe?  Maybe only
parsing errors? (I would expect them to be handled the same, but maybe
not)  Anything else I'm missing?  Thanks!

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message