<?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>23760</bug_id>
          
          <creation_ts>2013-11-07 14:35:21 +0000</creation_ts>
          <short_desc>[xslt 3.0] streamability of count(//para)</short_desc>
          <delta_ts>2014-05-15 14:00:46 +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>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="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>95954</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-11-07 14:35:21 +0000</bug_when>
    <thetext>Section 19.1 talks of the rewrite needed to make count(//section/head) streamable. However, what is described isn&apos;t good enough.

Firstly, it says the rewrite is only applied to a RelativePathExpr, but the example is not a relative path, it is absolute.

Secondly, it rewrites //section/head as //head[parent::section], but this is still not streamable, because //head expands to /descendant-or-self::node()/head which suffers the same problem (use of the child axis in a crawling posture is free-ranging).

We actually need to rewrite //para as /descendant-or-self::para()[parent::node()] (which further simplifies to /descendant::para, but I don&apos;t think that simplification is needed for stream ability), and we need to rewrite //section/head as /descendant-or-self::head[parent::section]. Perhaps this can be achieved by applying the rewrite recursively, I&apos;m not sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96921</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-11-28 21:31:15 +0000</bug_when>
    <thetext>I have made some small adjustments to this section which I believe fix the problem, by changing the examples a little and being less prescriptive about the precise form of the rewrite to be carried out.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>