Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#640 Errors not reported after doc-available()

v8.8
closed
Michael Kay
5
2012-10-08
2007-01-11
Michael Kay
No

This bug affects XQuery, and it also affects XSLT if the option to treat recoverable errors as fatal is chosen (-w2 on the command line).

If doc-available() is called and returns false (meaning the document is not available), then any subsequent dynamic error occurring in the query or transformation is not reported to the ErrorListener; the only evidence that an error occurred will be that the query or transformation quits with an exception. If run from the command line this means there will be a single message saying that the query or transformation has failed, with no indication of why.

The problem occurs because the implementation of doc-available() calls the supporting code for document() after setting a temporary ErrorListener designed to suppress any error messages such as XML parsing errors while the document is being read. In situations where document() treats such errors as fatal rather than recoverable, the error listener is then not reset to its original state.

A patch is in Subversion.

Discussion