Ahh. Thanks guys. I got it working now! -----Original Message----- From: Scott Sanders [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 12:52 PM To: Jakarta Commons Developers List Subject: RE: Digester parsing user question
What Richard said ;-) Scott > -----Original Message----- > From: Richard Frazer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 20, 2002 12:07 PM > To: Jakarta Commons Developers List > Subject: Re: Digester parsing user question > > > The digester implements ErrorHandler and is the default error handler > for the SAX Parser. The way it handles the "error" method is to just > print out a message and continue along. If you want to be able to do > your own thing, you must implement the ErrorHandler interface > yourself > and call digester.setErrorHandler(). > > Ex. > > digester = new Digester(); > digester.setErrorHandler( new LittleErrorHandler() ); > > Where LittleErrorHandler is defined like this: > > > private class LittleErrorHandler implements ErrorHandler > { > public void warning(SAXParseException e) > throws SAXException > { > return; > } > > public void error(SAXParseException e) > throws SAXException > { > throw e; > } > > public void fatalError(SAXParseException e) > throws SAXException > { > throw e; > } > } > > > Scott Sanders wrote: > > >As far as I know the code, all SAXExceptions are bubbled straight to > >the user (you), Digester 'swallows' nothing. > > > >Typically with a SAX parser, you get the first exception and then it > >fails. It is not like a compiler, which keeps reporting > errors, so you > >should be able to catch the first and only exception that the parser > >spits out. > > > >Cheers, > >Scott Sanders > > > >>-----Original Message----- > >>From: Kyle Robinson [mailto:[EMAIL PROTECTED]] > >>Sent: Wednesday, February 20, 2002 11:58 AM > >>To: '[EMAIL PROTECTED]' > >>Subject: Digester parsing user question > >> > >> > >>When I pass a badly formed xml document into my > >>digester.parse() method it seems to be handling an > >>SAXParseExceptions internally. How can I catch the > >>SAXParseExceptions myself? (For example: I want to add the > >>exception.getMessage() to a Vector of Strings) > >> > >>Any help would be appreciated, thanks. > >> > >>Kyle Robinson > >>Systems Consultant > >>Pangaea Systems Inc. > >>(250) 360-0111 > >> > >> > > > >-- > >To unsubscribe, e-mail: > <mailto:commons-dev-> [EMAIL PROTECTED]> > >For > additional commands, > e-mail: > ><mailto:[EMAIL PROTECTED]> > > > > > > -- > To unsubscribe, e-mail: > <mailto:commons-dev-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>