This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Under 19.8.4.24 Streamability of xsl:merge (http://www.w3.org/TR/xslt-30/#streamability-xsl-merge), the posture is missing. Also, it is not clear what the operands are for xsl:merge-source and whether xsl:merge-key is part of the operands. The current rule seems to indicate that the following is allowed: <xsl:merge> <xsl:merge-source select="." > <xsl:merge-key select="foo" /> </xsl:merge-source> <xsl:merge-action> <xsl:copy-of select="." /> </xsl:merge-action> </xsl:merge> Perhaps a bit senseless, and perhaps potentially streamable (I think it should not be streamable with the current rules), but I think we should at least name the operands. Also, I think we can do better here than only allowing motionless sources. I.e., when the for-each expression is absent or motionless and the select expression is consuming (or the reverse), and the merge-key is motionless, I think xsl:merge is streamable to the extend that merge-action is streamable. We might even go so far to consider xsl:merge streamable if the union of the select-expression is streamable, which would allow: <xsl:merge bind-key="grp"> <xsl:merge-source select="foo"> <xsl:merge-key select="@name" /> </xsl:merge-source> <xsl:merge-source select="bar"> <xsl:merge-key select="@name" /> </xsl:merge-source> <xsl:merge-action> <xsl:value-of select="$grp" /> </xsl:merge-action> </xsl:merge> because the expression "foo | bar" is a streamable pattern, "@name" is motionless and the merge-action is consuming.
We discussed this in Prague; the editor agrees that the current treatment is a bit cursory and will come back with a proposal.
I think we should keep this simple; doing a merge while we are already processing a streamed document is not a use case we need to pursue. So I think the rule should be: * The xsl:merge instruction is grounded and motionless if every xsl:merge-source child element satisfies the following conditions: ** The for-each-item expression, if present, is grounded and motionless ** The for-each-stream expression, if present, is grounded and motionless ** If neither the for-each-item nor for-each-stream attribute is present, then the select expression is grounded and motionless * Otherwise the xsl:merge instruction is roaming and free-ranging.
Independently of each other, we seem to have written down the exact same rules ;), see bug 24343, comment#5, item 6. I agree that we do not need to make the odd case of a merge action on the current streamed document streamable.
On 2014-03-06 the WG accepted the proposal in comment 2, subject to wording changes to improve readability. The changes have been applied.