This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
We carefully disallow binding of variables to nodes in a streamed document. Except that we don't. We provide a workaround: <xsl:for-each-group select="." group-adjacent="0" bind-group="var"> which is just another way of doing <xsl:variable name="var" select="."/> Having a variable bound to the streamed node is really useful in some contexts, e.g. inside xsl:analyze-string where the context item has been switched to a string. So people will undoubtedly use the workaround if we leave it open. Now either grouping variables work, in which case we can use the same mechanisms to make ordinary streamed variables work; or they don't work, in which case we need to fix them. I have a feeling that with the new "posture" mechanism, we can make streamed variables work. The essence of the solution is that the posture of a variable reference is the same as the posture of the initialising expression of the variable.
Related note (posted in email today): The current rules for for $v in S return R are • If R is not grounded and motionless, then roaming and free-ranging. • Otherwise, the posture and sweep of S. Firstly, rule 1 is ambiguous.The intended reading is (not(grounded and motionless)) rather than (not(grounded) and motionless). But the requirement to be motionless seems unnecessary. It disallows, for example for $x in product/copy(.) return $x/price - $x/discount Secondly, the rule as written allows for $x in 1 to 3 return child::product which should not be streamable. Assuming we don't pursue the idea of binding variables to streamed nodes (see bug 23391), I think the rules should be: 1. If R is not grounded, then roaming and free-ranging 2. Otherwise, the general streamability rules apply, where the two operands are: * S (usage navigation) * R (usage transmission, higher-order)
The Working Group examined this further (see email archive) and decided to make no change to the specification.