<?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>19659</bug_id>
          
          <creation_ts>2012-10-22 21:13:47 +0000</creation_ts>
          <short_desc>[XSLT 3.0] error in streamability rules for ./x</short_desc>
          <delta_ts>2014-05-15 14:00:22 +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>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>76926</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-10-22 21:13:47 +0000</bug_when>
    <thetext>There is an error (or at any rate, a serious limitation) in the streamability rules for relative path expressions. The spec (section 19.3.7, RelativePathExpr [35]) says that if the first step of the path expression is motionless, then the path expression is motionless. 

Consider the expression ./x, or equivalents such as (. treat as node())/x.

The syntactic context of the LHS of &quot;/&quot; is a navigation context; &quot;.&quot; in a navigation context is free-ranging; therefore ./x is free-ranging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82973</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-02-12 10:52:08 +0000</bug_when>
    <thetext>Disucssed by the WG today. 

Needs further investigation to see if we can identify a solution. Alternatively, can we live with the restriction that such expressions are not guaranteed streamable?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83657</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-02-25 15:16:32 +0000</bug_when>
    <thetext>I believe the problem can be fixed by adding another streamability rule for RelativePathExpr after:

If the first StepExpr is motionless, then motionless

namely

if either operand is a ContextItemExpr, or an AxisStep using the self axis in which all predicates are motionless, then the streamability of the other operand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87179</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-02 16:37:36 +0000</bug_when>
    <thetext>I propose the following text.

In 19.3.7, Classifying expressions, change the entry for RelativePathExpr [35] as follows:

Change the first paragraph to:

The RelativePathExpr is first preprocessed as follows:

(a) Any &apos;//&apos; pseudo-operator is expanded to &apos;/descendant-or-self::node()/&apos;

(b) The expression tree is written in such a way that &apos;/&apos; is a binary operator, for example a/b/c becomes (a/b)/c.

The following rules then apply to a RelativePathExpr that has &apos;/&apos; as its operator, with two operands. The streamability is the first of the following that applies:

1. If either operand is a ContextItemExpr (&quot;.&quot;) or an AxisExpression using the self axis, optionally followed (in either case) by one or more motionless predicates,
then the streamability of the other operand.

2. (existing rule 1, et seq, unchanged)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87759</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-16 11:41:27 +0000</bug_when>
    <thetext>The proposed text was accepted (2 May 2013) and has been incorporated in the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>