Exception raised by xsl:message terminate="yes" is intercepted by an Atomizer
When the result of an expression needs to be atomized, and that expression fails because of
<xsl:message terminate="yes">, the atomizer catches the termination exception and adds to the exception message; in the course of this it loses the fact that the exception originated with xsl:message, and as a consequence (for example) the dynamic error information variable
$err:value is incorrectly set when the exception is subsequently caught by a try/catch.
The Atomizer expression recognises the exception thrown by a call to fn:error() and treats it specially; it needs to do the same with the exception thrown by a call to xsl:message.
Raised by AirQuick on the saxon-help mailing list.
Updated by Michael Kay about 2 years ago
Note that there's a slight change here between 9.9 and 10.0. In 10.0, the Atomizer intercepts all exceptions other than the
UserDefinedXPathException raised by a call to
fn:error(). In 9.9, it intercepts all exceptions other than those whose error code is in a non-standard namespace. Also, in 9.9,
SingletonAtomizer does not intercept the exception.
Please register to edit this issue