From 4870e76020320b8418f036758ca237edf2ad890d Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Wed, 16 Oct 2024 17:37:46 +0100 Subject: [PATCH 1/2] Add err:map, err:stack-trace, err:additional to XSLT --- .../xslt-40/src/element-catalog.xml | 1 - specifications/xslt-40/src/xslt.xml | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/specifications/xslt-40/src/element-catalog.xml b/specifications/xslt-40/src/element-catalog.xml index e2f00aabe..d3cb696cd 100644 --- a/specifications/xslt-40/src/element-catalog.xml +++ b/specifications/xslt-40/src/element-catalog.xml @@ -1704,7 +1704,6 @@ - diff --git a/specifications/xslt-40/src/xslt.xml b/specifications/xslt-40/src/xslt.xml index 63447a7f5..d33a033c0 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -15690,6 +15690,14 @@ and version="1.0" otherwise.

Try/Catch + + + + New variables err:stack-trace, err:additional, + and err:map are available within an xsl:catch clause. + + +

The xsl:try instruction can be used to trap dynamic errors occurring within the expression it wraps; the recovery action if such @@ -15845,6 +15853,28 @@ and version="1.0" otherwise.

instruction where the error occurred; an empty sequence if the information is not available. The value may be approximate. + + err:stack-trace + fn() as xs:string? + A zero-arity function which, when called, returns + an string containing diagnostic + information about the state of execution at the point where the error occured, + or an empty sequence if no stack trace is available. + + + err:additional + item()* + Additional + information about the error. + + + err:map + map(xs:string, item()*) + A map with entries that are bound to the variables + above. The local names of the variables are assigned as keys. No map entries + are created for those values that are empty sequences. The variable can be + used to pass on all error information to another function. + From e61b9b937a9b720038e0194eb31446ff89175fa9 Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Tue, 26 Nov 2024 17:12:49 +0000 Subject: [PATCH 2/2] err:stack-trace is now a string not a function --- specifications/xslt-40/src/xslt.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specifications/xslt-40/src/xslt.xml b/specifications/xslt-40/src/xslt.xml index d33a033c0..bb24ec536 100644 --- a/specifications/xslt-40/src/xslt.xml +++ b/specifications/xslt-40/src/xslt.xml @@ -15855,9 +15855,9 @@ and version="1.0" otherwise.

err:stack-trace - fn() as xs:string? - A zero-arity function which, when called, returns - an string containing diagnostic + xs:string? + An + string containing diagnostic information about the state of execution at the point where the error occured, or an empty sequence if no stack trace is available.