[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT 3.0: Catching an error in the declaration/ initi

Subject: XSLT 3.0: Catching an error in the declaration/ initialization of a variable that is outside of <xsl:try>
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Jan 2015 04:11:30 -0000
 XSLT 3.0: Catching an error in the declaration/  initi
In the 2nd Last Call of the W3C XSLT 3.0 specification, almost at the
end of section 8.3 "Try/Catch",
http://www.w3.org/TR/2014/WD-xslt-30-20141002/#try-catch, there is an
enumerated list of additional rules that apply to the catching of

Of these, Rule 1 says:

"All dynamic errors occurring during the evaluation of the xsl:try
sequence constructor or select expression are caught (provided they
match one of the xsl:catch elements).

 - This includes errors occurring in functions or templates invoked in
the course of this evaluation, unless already caught by a nested

 - It also includes errors caused by calling the error function, or
the xsl:message instruction with terminate="yes", or the xsl:assert

- It does not include errors that occur while evaluating references to
variables whose declaration and initialization is outside the xsl:try"

I wrote a small transformation with the purpose of demonstrating the
last bullet:

<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    <xsl:output method="text"/>

    <xsl:param name="pAmount" select="t"/>

    <xsl:variable name="vAmount" as="xs:decimal" select="$pAmount"/>

    <xsl:template match="/">
            <xsl:sequence select="$vAmount"/>
            <xsl:catch select="-99999999"/>

And I expected that, according to the quoted rule above, the error in
initializing the variable "vAmount" would not be caught, because this
variable's declaration and initialization is outside of the <xsl:try>

However, the result of the transformation, when run with SaxonEE 9.6.02 is:


My question:

Is this a Saxon bug, or is the specification incorrect, or am I not
understanding correctly the rule quoted above.
If the last of these is true, could someone, please, provide an
example, whose running would demonstrate the 3rd bullet of the rule
quoted above?

Dimitre Novatchev

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.