Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#106 No diagnostics with Crimson parser

v7.3
closed
Michael Kay
3
2012-10-08
2002-11-21
Michael Kay
No

When Saxon is used with the Crimson XML parser, an
exception occurring in Saxon code while parsing is in
progress is not properly reported. Crimson wraps the
exception in a SAXException and returns it from the
call of parse(), but without calling the ErrorHandler.
The result is that Saxon terminates with the message
"Transformation failed - run-time errors were
reported", but with no indication of what caused the
failure.

Applies to 7.3 and probably all earlier releases when
Crimson is used as the parser. The problem only
manifests itself when errors occur in parser
call-backs, which might be because of an internal Saxon
problem, or perhaps a problem in an extension function
called in preview mode.

Source code fixed: in the method
net.sf.saxon.event.Builder#build(), in the catch block
for errors from parser.parse(), add the code:

        if (!failed) {
            // the error handler has not been called
            TransformerException te = new

TransformerException(err2);
te.printStackTrace();
throw te;
}

Discussion

  • Michael Kay
    Michael Kay
    2002-12-10

    Logged In: YES
    user_id=251681

    Fixed in 7.3.1.

    An unfortunate side-effect of the fix is that sometimes a
    stacktrace is produced unnecessarily.