Finn Bock wrote:
and there is no way AFAICT to set a different error handler on the XMLReader that the xalans transformer creates and uses to parse the input file.

Well, if you really need control over the parser, you have to create one by yourself rather than relying on StreamSource to do it for you. You can cast the TransformerFactory instance into a SAXTransformerFactory in order to get a filter which you can pass to the parser instance as content handler. Look into Cocoon's XSLTransformer component for a comprehensive example, and I'm sure the Xalan docs have even easier to grok sample code.

Alternatively, you can
- parse into a DOM and use a DOMSource, if you don't mind
 the potential memory overhead.
- derive a custom class from SAXSource which sets up a
 properly custiomized parser instance, if you don't mind
 the programming overhead.


Reply via email to