<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29733</bug_id>
          
          <creation_ts>2016-07-15 10:43:48 +0000</creation_ts>
          <short_desc>[xslt 3.0] Why you can&apos;t pass streamed nodes to the second argument of a streamable stylesheet function</short_desc>
          <delta_ts>2016-08-25 15:56:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>126958</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-07-15 10:43:48 +0000</bug_when>
    <thetext>Consider the example in 19.8.5.2

Example: An absorbing stylesheet function with two arguments

&lt;xsl:function name=&quot;f:compare-size&quot; as=&quot;xs:integer&quot; streamability=&quot;absorbing&quot;&gt;
  &lt;xsl:param name=&quot;input0&quot; as=&quot;node()&quot;/&gt;
  &lt;xsl:param name=&quot;input1&quot; as=&quot;node()&quot;/&gt;
  &lt;xsl:sequence select=&quot;count($input0//*) - count($input1//*)&quot;/&gt;
&lt;/xsl:function&gt;

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:

&quot;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.&quot;

This explanation doesn&apos;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&apos;s pretty much a consequence of the GSRs that the supplied expression for a navigation operand must be grounded.

We should change the explanation: &quot;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127025</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-07-21 17:08:31 +0000</bug_when>
    <thetext>The proposed change was accepted by the WG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127234</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-08-25 15:56:43 +0000</bug_when>
    <thetext>The change has been applied to the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>