This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29733 - [xslt 3.0] Why you can't pass streamed nodes to the second argument of a streamable stylesheet function
Summary: [xslt 3.0] Why you can't pass streamed nodes to the second argument of a stre...
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-15 10:43 UTC by Michael Kay
Modified: 2016-08-25 15:56 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2016-07-15 10:43:48 UTC
Consider the example in 19.8.5.2

Example: An absorbing stylesheet function with two arguments

<xsl:function name="f:compare-size" as="xs:integer" streamability="absorbing">
  <xsl:param name="input0" as="node()"/>
  <xsl:param name="input1" as="node()"/>
  <xsl:sequence select="count($input0//*) - count($input1//*)"/>
</xsl:function>

We state:

Not streamable: f:compare-size(a, b) where a is an element in an unstreamed document and b is an element in a streamed document

The explanation given is:

"The reason for the asymmetry is that the rules given in 19.8.8.11 Streamability of Variable References treat the variable references $input0 and $input1 differently: the rules assume that $input1 will not be bound to a streamed node."

This explanation doesn't hold water. The rules for variable references say that $input1 is grounded and motionless. The actual reason is that for an absorbing function call, the GSRs apply, and the operand usage for the second argument is navigation, and it's pretty much a consequence of the GSRs that the supplied expression for a navigation operand must be grounded.

We should change the explanation: "The reason for the asymmetry is that for the first argument the operand usage is absorption, while the for the second it is navigation:  the GSRs ensure that when streamed nodes are supplied to an operand with usage navigation, the resulting expression is roaming and free-ranging.
Comment 1 Michael Kay 2016-07-21 17:08:31 UTC
The proposed change was accepted by the WG.
Comment 2 Michael Kay 2016-08-25 15:56:43 UTC
The change has been applied to the spec.