On 18 Feb 2014, at 13:47, David Rudel <fwqhgads@gmail.com> wrote:

Thanks, Michael, for the reply.
Am I correct in believing that, while waiting for Saxon 9.6, using saxon:stream() is probably as good a solution as any for burst-mode streaming? Or is it better to default to using xsl:iterate inside an <xsl:stream> element to do this?

Yes, probably. There were not many tests for xsl:stream in 9.5. I've created large number of tests since 9.5 came out, and I don't know how many of them run successfully in 9.5, but it's not nearly as many as I would like.

Michael Kay
Saxonica


On Tue, Feb 18, 2014 at 1:45 PM, Michael Kay <mike@saxonica.com> wrote:

On 18 Feb 2014, at 11:58, David Rudel <fwqhgads@gmail.com> wrote:

I'm having difficulty using burst-mode streaming using either of the standard methods detailed in the 9.5 documentation.

I've used burst-mode-streaming in the past with saxon:stream, but now it does not appear to be working. When I try

    <xsl:for-each select="saxon:stream(doc($path||'Mock_Echo_Test_1.xml')//day[+@session-day gt 1]/item[@model.error ne ''])">
                <i bin1="{round(@model.error div $bin.width)}" bin2="{round(@current.error div $bin.width)}"/>
            </xsl:for-each>

Saxon does not process using streaming. -t shows an effort at building a tree for a 2GB document.

Notably, modifying the path statement fixes this. When I try:
<xsl:for-each select="saxon:stream(doc($path||'Mock_Echo_Test_1.xml')//item[@model.error ne ''])">
                <i bin1="{round(@model.error div $bin.width)}" bin2="{round(@current.error div $bin.width)}"/>
            </xsl:for-each>

Saxon does process using streaming. I don't see why the inclusion of "/day[+@session-day gt 1]" into the path should prevent streaming.

I can't see why immediately either, I'll look into it.


Perhaps more importantly, I get errors when trying the "proper" XSLT3 syntax, copying and pasting code directly from the Saxon documentation page:

<xsl:stream href='employees.xml'> <xsl:apply-templates select="copy-of(*/employee)"/> </xsl:stream>

When I put this into oXygen, processing using 9.5.1.3, I get the following errors:

Engine name: Saxon-EE 9.5.1.3
Severity: warning
Description: The body of the xsl:stream instruction is not guaranteed streamable according to W3C rules * There is an xsl:apply-templates instruction using a non-streamable mode
Start location: 33:37

Engine name: Saxon-EE 9.5.1.3
Severity: warning
Description: Evaluation will always throw a dynamic error: Expression xsl:apply-templates is free-ranging * There is an xsl:apply-templates instruction using a non-streamable mode
Start location: 33:0

Engine name: Saxon-EE 9.5.1.3
Severity: fatal
Description: SXST0060: Expression xsl:apply-templates is free-ranging * There is an xsl:apply-templates instruction using a non-streamable mode
Start location: 33:0
URL: http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/trans/SaxonErrorCode.html#SXST0060

The basic problem here is a major bug in the streamability rules in the 2012 XSLT 3.0 spec, which Saxon 9.5 faithfully implemented. It basically means that the rules take no account of the "copy-of". Retrofitting the corrected 2013 rules into 9.5 doesn't look feasible, so I don't think it's going to be possible to fix this before 9.6, which is still some months away. It might be worth trying a workaround of binding the result of "copy-of" to a variable.

Michael Kay
Saxonica


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help