Will Sappington wrote:
When putting the program I’m writing through some error testing with a file that contains malformed XML, XalanSourceTreeParserLiaison::parseXMLStream() is throwing a “generic” (…) exception and writing an error message to cout/cerr. I’d like to be able to capture that output and write it to the log file that the program is using for its error output. I’ve dug a little into the XercesParserLiaison setErrorHandler stuff, , couldn’t find anything in the sample code or the archives that referenced ErrorHandlerType. This is far from my top priority so I can’t spend much time researching it but I’d really like to be able to modify this behavior. I’m hoping someone can point me where to look or provide an example of how to set up an error handler that will let me capture this output. Thanks in advance,
ErrorHandlerType is just a typedef for the Xerces-C base class ErrorHandler. If you look at the source code for XercesParserLiaison, you'll see it implements that base class, so you can use it as a model for your own.
Dave