<?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>27960</bug_id>
          
          <creation_ts>2015-02-04 19:52:29 +0000</creation_ts>
          <short_desc>[XSLT30] Grounded filter expressions appear to be roaming and free-ranging in the analysis</short_desc>
          <delta_ts>2015-02-26 21:34:09 +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>
          
          
          <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>117696</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-02-04 19:52:29 +0000</bug_when>
    <thetext>In section 19.8.7.8 Streamability of Filter Expressions, a filter expression B[P] is considered in situations (1) when B is crawling, (2) when P is motionless and otherwise, the rules state that it is roaming and free-ranging.

These rules seem to be incomplete. 

Consider $doc[child::foo]. $doc is a VarRef, which is grounded by default (except in functions). The expression should therefor be grounded and motionless.

I think it would work if we change:

&quot;2. If P is motionless, then the posture and sweep of B;&quot;, 

such that we make sure that P is assessed with the context posture set to the posture of B, in which case $doc, which has grounded posture, would yield child::foo in the example above as motionless.

Alternatively or in addition, we could simply add a rule: &quot;If B is grounded, B[P] is grounded and motionless&quot;.

In fact, it looks like we don&apos;t say at all what the context posture is in cases of filter expressions. And rule 5 of 19.8.7.7 Streamability of Axis Steps doesn&apos;t say it either for predicates in axis steps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117713</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-02-05 17:00:53 +0000</bug_when>
    <thetext>In your example, the predicate child::foo is motionless, because the context posture is grounded. So I think there is no bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117714</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-02-05 17:26:55 +0000</bug_when>
    <thetext>I think the problem lies in the fact that it is unclear that P should be assessed with context posture of B. In (some?) other situations, we write stuff like (example from 19.8.7.5 Streamability of Simple Mapping Expressions):

&quot;The posture and sweep of the expression are the posture and sweep of the right-hand operand, assessed with a context posture and type set to the posture and type of the left-hand operand.&quot;

I&apos;m not sure if a change is needed, assuming this information is provided elsewhere, but it is not very clear that one need to analyze P this way (though intuitively one could say it is).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117729</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-02-06 18:31:21 +0000</bug_when>
    <thetext>The WG agreed that the spec is correct but that some clarification would be helpful, for example a note under the streamability of filter expressions as to how the context posture for the predicate is determined, and the consequence that if the base expression is grounded then the whole expression is typically grounded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118189</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-02-26 21:34:09 +0000</bug_when>
    <thetext>A suitable clarification has been added to the section on streamability of filter expressions, as suggested.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>