This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23760 - [xslt 3.0] streamability of count(//para)
Summary: [xslt 3.0] streamability of count(//para)
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 14:35 UTC by Michael Kay
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2013-11-07 14:35:21 UTC
Section 19.1 talks of the rewrite needed to make count(//section/head) streamable. However, what is described isn'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'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'm not sure.
Comment 1 Michael Kay 2013-11-28 21:31:15 UTC
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.