Project

Profile

Help

Support #2009

closed

saxon:stream not causing streaming

Added by David Rudel about 10 years ago. Updated about 10 years ago.

Status:
Won't fix
Priority:
Low
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2014-02-18
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I mentioned this on the Saxon list, and based on M. Kay's response there, I thought I should post here with a snippet of my source code.

When using the following code, Saxon successfully streams the source file snippet.xml:

<xsl:for-each select="saxon:stream(doc($path||'snippet.xml')//item[@model.error ne ''])">

<i bin1="{round(@model.error div $bin.width)}" bin2="{round(@current.error div $bin.width)}"/>

</xsl:for-each>

However, including an extra step in the path: /day, causes Saxon to switch to non-streaming mode:

<xsl:for-each select="saxon:stream(doc($path||'snippet.xml')//day/item[@model.error ne ''])">

<i bin1="{round(@model.error div $bin.width)}" bin2="{round(@current.error div $bin.width)}"/>

</xsl:for-each>


Files

snippet.xml (72.7 KB) snippet.xml David Rudel, 2014-02-18 15:03
Actions #1

Updated by Michael Kay about 10 years ago

The explanation for this is that the expression //item is "naturally sorted" - it gets optimized to /descendant::item, which selects nodes in document order without needing any sorting; while //day/item is not - see section 19.1 of the Dec 2013 XSLT 3.0 specification to see why. Saxon evaluates //day/item as sort(/descedant::day ! child::item), and the presence of the sort() prevents streaming.

Saxon 9.6 solves this one in the way described in section 19.1 of the spec. In fact some paths in Saxon handle this better than the XSLT 3.0 spec (e.g. for-each and apply-templates), but not saxon:stream().

Actions #2

Updated by Michael Kay about 10 years ago

  • Tracker changed from Bug to Support
  • Category changed from Saxon extensions to Streaming
  • Status changed from New to Won't fix
  • Assignee set to Michael Kay
  • Found in version changed from 9.5.1.3 to 9.5

Please register to edit this issue

Also available in: Atom PDF