[Bug 29670] [XSLT30] xsl:accumulator/ @initial-value accessing the global context item and streamability

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29670

--- Comment #1 from Michael Kay <mike@saxonica.com> ---
>Similar to global variables, xsl:accumulator can access the global context item (GCI) through the @initial-value attribute.

This is not quite accurate. 18.2.1 says:

The expression in the initial-value attribute is evaluated with a singleton
focus based on the root node of the [streamed] input tree to which the
accumulator is being applied.

(The word "streamed" is present in the text and should be removed)

So an accumulator can reference the GCI only in the case where it is being
applied to the tree rooted at the GCI.

If the GCI is a streamed node, then an accumulator is applicable to the GCI
only if it is declared streamable (§18.2.2), and in this case we require
(§18.2.8) that the initial-value expression is grounded and motionless.

I don't think it's necessary to change the rules for accumulators that are
eclipsed by virtue of import precedence. We allow you to override a
non-streamable accumulator with a streamable one, and that meets the
requirement we're trying to address.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 27 May 2016 10:04:07 UTC