<?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>27075</bug_id>
          
          <creation_ts>2014-10-16 11:43:44 +0000</creation_ts>
          <short_desc>[xslt3.0ts] Streamability of void path expressions</short_desc>
          <delta_ts>2015-05-06 21:14:53 +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 Test Suite</component>
          <version>Working 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="Abel Braaksma">abel.online</assigned_to>
          <cc>abel.braaksma</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>113298</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-10-16 11:43:44 +0000</bug_when>
    <thetext>A number of the new Posture+Sweep tests use void path expressions, for example A030 uses

&lt;xpath&gt;descendant::document-node()/attribute()&lt;/xpath&gt;

Rule 3 for streamability of axis steps (19.8.7.7) says:

If the statically-inferred context item type is such that the axis will always be empty (for example, applying the child axis to a text node or the parent axis to a document node), or if the NodeTest is one that can never select nodes on the chosen axis (for example, selecting attribute nodes on the child axis), then the sweep is motionless and the posture is grounded (because the expression is statically known to return an empty sequence);

In this example both axis steps fall under this rule, so they are both Grounded+Motionless, and therefore (under the rules for path expressions in 19.8.7.6) the path expression as a whole is Grounded+Motionless. The expected result of the test case is given as Climbing+Consuming. 

There are other tests where only one of the axis steps is void under this rule, for example

&lt;xpath&gt;descendant-or-self::foo/namespace::attribute()&lt;/xpath&gt;

In this case I believe the spec gives the result as Grounded+Consuming, which is reasonable enough. Saxon is smarter, and computes the result as Grounded+Motionless, because it has already worked out that the entire path expression is void. The expected result in the test case, however, is Climbing+Consuming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113347</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-10-16 19:57:36 +0000</bug_when>
    <thetext>&gt; descendant::document-node()/attribute()

This appears to be an error in _base-expressions.xml where the descendant::document-node() step expression is classified as able to return document nodes, which obviously it can&apos;t:

&lt;production node-type=&quot;document&quot;&gt;descendant::document-node()&lt;/production&gt;


&gt; descendant-or-self::foo/namespace::attribute()

In _base-expressions.xml there appeared to be copy and paste error:

&lt;production node-type=&quot;attribute&quot;&gt;namespace::attribute()&lt;/production&gt;
&lt;production node-type=&quot;attribute&quot;&gt;namespace::attribute(*)&lt;/production&gt;
&lt;production node-type=&quot;attribute&quot;&gt;namespace::attribute(ex:foo)&lt;/production&gt;
&lt;production node-type=&quot;attribute&quot;&gt;namespace::attribute(Q{http://example.com}foo)&lt;/production&gt;

these productions should all be classified as node-type &quot;empty&quot;, because they can never select anything.

I fixed the base expressions and reran the generator and the first is now &quot;grounded, motionless&quot; and the second is &quot;grounded, consuming&quot; as per the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113350</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-10-16 20:17:16 +0000</bug_when>
    <thetext>Fixed in repository.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120161</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-05-06 21:14:53 +0000</bug_when>
    <thetext>Was resolved &gt; 30 days ago, closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>