W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2013

[Bug 24179] New: [xslt 3.0] References to local variables within xsl:iterate/xsl:on-completion

From: <bugzilla@jessica.w3.org>
Date: Mon, 30 Dec 2013 11:12:59 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-24179-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24179

            Bug ID: 24179
           Summary: [xslt 3.0] References to local variables within
                    xsl:iterate/xsl:on-completion
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org

(From a Saxon bug report by David Rudel)

Consider:

<xsl:iterate select="*">
  <xsl:param name="p" select="0"/>
  <xsl:variable name="v" select="$p + number(.)"/>
  <xsl:on-completion select="$v"/>
</xsl:variable>

We say explicitly that xsl:on-completion can make reference to the local
parameters of the xsl:iterate instruction, but we say nothing about references
to local variables.

Under the scoping rules for local variables, $v is in scope, but what is its
value? The obvious answer would be, the value to which it is bound during the
final iteration, that is the value computed while processing the last member of
the input sequence. But what if the input sequence is empty? It seems that the
variable would then be in scope, but having no value, which is a situation
without precedent.

The only workable answer to this I can see is to say that $v is out of scope
within xsl:on-completion. This is consistent with the rule that there is no
context item within xsl:on-completion.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Monday, 30 December 2013 11:13:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:45 UTC