xsl:catch

In conjunction with xsl:try, the xsl:catch instruction allows recovery from dynamic errors.

Content: sequence-constructor
Permitted parent elements: xsl:try

Attributes

errors?

tokens

Indicates which error codes are caught. If absent, or if set to *, all errors are caught. The value can be a whitespace-separated list of QNames; the wildcards *:local or prefix:* can also be used.

select?

expression

The effect of the element may be defined either by a select attribute, or by an enclosed sequence constructor.

Saxon availability

Available in XSLT 3.0. From Saxon 9.8, available in all editions. Implemented in Saxon-PE and Saxon-EE since Saxon 9.6. Available for all platforms.

Details

It is possible to have more than one xsl:catch within an xsl:try; the first one that matches the error is used.

Within the xsl:catch, a number of variables are available in the namespace http://www.w3.org/2005/xqt-errors:

The error can be re-thrown by using the error() function.

Links to W3C specifications

XSLT 3.0 Specification

See also

xsl:try