<?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>29492</bug_id>
          
          <creation_ts>2016-02-20 18:19:56 +0000</creation_ts>
          <short_desc>[XSLT30] streamability of xsl:attribute-set may not be complete</short_desc>
          <delta_ts>2016-10-06 18:42:23 +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>Windows NT</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="Abel Braaksma">abel.braaksma</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>125187</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-02-20 18:19:56 +0000</bug_when>
    <thetext>I have spent some time disentangling the rules on xsl:attribute-sets with regards to guaranteed streamability and I think we are missing some key point here.

a) under 10.2.3 we say &quot;considered as a seqtor&quot; and then point to 19.8.6 where this precondition seems not to apply anymore

b) under 19.8.6 Classifying Attribute Sets we say &quot;usage transmission&quot;, but attribute sets are always grounded

c) under 19.8.6 we don&apos;t say anything about the context posture

d) section on xsl:element classifies @use-attribute-sets with usage absorption, this seems to not make sense

I think all of these can be fixed by treating the streamability similar to other declarations (i.e., accumulators and stylesheet functions) where the direction of streaming is not known beforehand.

Suggestions:

1) Under 10.2.3. item (2): every xsl:attribute-set has motionless sweep and grounded posture according to the rules in Classifying Attribute Sets

2) Under 19.8.6.: remove the reliability on the general streamability rules

3) Under 19.8.6.: Change the text to something like (all apply):
   i)   The posture of an attribute set is grounded
   ii)  The sweep of an attribute set is motionless if all xsl:attribute instructions are motionless according to the streamability rules on xsl:attribute with the context posture set to striding.
   iii) Otherwise free-ranging.

4) Under 19.8.6: add in a Note that all referenced attribute sets must have streamable=&quot;yes&quot; and abide by those rules, and/or point back to 10.2.3.

5) Replace any place where @use-attribute-sets is mentioned in the streamability rules and (perhaps) point to the section on Classifying Attribute Sets. I don&apos;t think they should have a usage, but if any, the usage is inspection and have themselves no additional operands, as they are not allowed to &quot;absorb&quot; any node.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126422</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-05-12 11:07:52 +0000</bug_when>
    <thetext>a) under 10.2.3 we say &quot;considered as a seqtor&quot; and then point to 19.8.6 where this precondition seems not to apply anymore

Agreed. Delete &quot;considered as a sequence constructor&quot;.

b) under 19.8.6 Classifying Attribute Sets we say &quot;usage transmission&quot;, but attribute sets are always grounded

Under the GSR, I think operand usage is irrelevant if the operand is grounded. So this doesn&apos;t actually matter; but using &quot;absorption&quot; might be clearer.

c) under 19.8.6 we don&apos;t say anything about the context posture

True, and this could potentially be a difficulty, which your proposal eliminates

d) section on xsl:element classifies @use-attribute-sets with usage absorption, this seems to not make sense

Again, the attribute set is grounded, so the operand usage does not make much difference.

I think all of these can be fixed by treating the streamability similar to other declarations (i.e., accumulators and stylesheet functions) where the direction of streaming is not known beforehand.

Suggestions:

1) Under 10.2.3. item (2): every xsl:attribute-set has motionless sweep and grounded posture according to the rules in Classifying Attribute Sets

Yes.

2) Under 19.8.6.: remove the reliability on the general streamability rules

Interesting...

3) Under 19.8.6.: Change the text to something like (all apply):
   i)   The posture of an attribute set is grounded
   ii)  The sweep of an attribute set is motionless if all xsl:attribute instructions are motionless according to the streamability rules on xsl:attribute with the context posture set to striding.
   iii) Otherwise free-ranging.

This drops the current possibility for an attribute-set to be consuming. I think that&apos;s probably a useful simplification, since it&apos;s very hard to think of practical use-cases where people would want this, and those use-cases can always be achieved by replacing the attribute-set with a streamable template rule.

4) Under 19.8.6: add in a Note that all referenced attribute sets must have streamable=&quot;yes&quot; and abide by those rules, and/or point back to 10.2.3.

5) Replace any place where @use-attribute-sets is mentioned in the streamability rules and (perhaps) point to the section on Classifying Attribute Sets. I don&apos;t think they should have a usage, but if any, the usage is inspection and have themselves no additional operands, as they are not allowed to &quot;absorb&quot; any node.

OK, I think that probably works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126427</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-05-12 13:16:07 +0000</bug_when>
    <thetext>&gt; This drops the current possibility for an attribute-set to be consuming. I 
&gt; think that&apos;s probably a useful simplification,
Agreed. There&apos;s a myriad of other ways to achieve this. Furthermore, this simplifies overriding as a processor will know beforehand that an attribute set is never going to consume and can inline the code without worrying about streamability issues.

&gt; I don&apos;t think they should have a usage, but if any, the usage is inspection and 
&gt; have themselves no additional operands, as they are not allowed to &quot;absorb&quot; any 
&gt; node.
My stance is now that they can be removed from the operands (perhaps with a Note), or alternatively, as we do with some other non-relevant (i.e., always grounded) operands, add a note that this or that is the operand usage and role, but that it does not influence the analysis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126668</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-02 22:30:48 +0000</bug_when>
    <thetext>The changes were agreed and have been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>