<?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>24491</bug_id>
          
          <creation_ts>2014-02-05 00:56:02 +0000</creation_ts>
          <short_desc>Static type of a construct &lt;&gt; expr is not always item()</short_desc>
          <delta_ts>2014-02-14 17:21:03 +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>Last Call drafts</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>
          <cc>cmsmcq</cc>
          
          <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>99716</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-02-05 00:56:02 +0000</bug_when>
    <thetext>In 19.2 we say:

&quot;For constructs other than expressions, the static type for the purpose of streamability analysis is taken as item().&quot;

I don&apos;t think this is correct, some constructs, like xsl:function, are analyzed based on the as-type of the xsl:param elements, they are not always item().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99759</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-05 10:22:57 +0000</bug_when>
    <thetext>I&apos;d be grateful for specific examples.

xsl:function is a declaration, it is not a &quot;construct&quot; as this term is used in the streamability analysis. A function call is analysed based on the xsl:function/@as attribute, but the function call is an expression and that&apos;s covered by the existing rules.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99788</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-02-05 15:46:03 +0000</bug_when>
    <thetext>You are right that xsl:function is not an instruction, and thus not a construct for streamability analysis, I didn&apos;t consider that. The call to a function is, however, a construct, but that is already covered.

Another appearance where we have a construct, but not the static type of item() is xsl:variable:

&lt;xsl:variable name=&quot;foo&quot; as=&quot;xs:string&quot;&gt;
   &lt;xsl:value-of select=&quot;bar&quot; /&gt;
&lt;/xsl:variable&gt;

This is allowed in streaming, is a construct, but has type other than item(). The streamability works here, because the sequence constructor is grounded. But even if the sequence constructor contained xsl:sequence instead of xsl:value-of, it would still be grounded, however, that is not covered in the streamability of xsl:variable currently, I believe (the operand role is the seqtor, the usage is navigation, though we could use TDU here, albeit a bit off-topic for this bug-report).

Perhaps I misunderstand the mentioned sentence. Apparently, TDU is only applied to operand roles, not to whole constructs, in which case the sentence itself is true, albeit for me a tad confusing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100260</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2014-02-11 11:26:02 +0000</bug_when>
    <thetext>We discussed this at the face to face meeting in Prague.

In 19.8.4.38, we say that the usage of the @select is navigation, but in fact we could usefully say that in the presence of an @as attribute, the declaration has type-determined usage.  (As suggested in comment 2.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100597</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-14 17:21:03 +0000</bug_when>
    <thetext>The change agreed for this bug has in fact already been made under the resolution of bug #24109. No further action needed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>