Thanks for analyzing and tracking this.


From: Michael Kay []
Sent: 28 January 2013 17:01
Subject: Re: [saxon] saxon:read-once does not use streaming


Sorry for the delay in responding to this. It seems a bug has crept in that causes the saxon:read-once attribute to not be recognized. We will produce a patch for this. In the meantime, can I suggest you use the alternative construct:

<xsl:copy-of select="saxon:stream(doc('inputfile.xml')//node)"/>

which is commented out in your stylesheet, and which appears to be working OK.

The bug (which also affects other optimization hints such as saxon:memo-function and saxon:threads) is logged here for tracking purposes:

Michael Kay

On 22/01/2013 12:02, Amarnath B S wrote:

2nd try. Kindly help. 
-----Original Message-----
From: Amarnath B S 
Sent: 18 January 2013 19:42
Subject: [saxon] saxon:read-once does not use streaming
Resending with correct subject.
-----Original Message-----
From: Amarnath B S 
Sent: 18 January 2013 19:39
To:; ''
I cannot get saxon:read-once to work. The XSLT is pretty simple (attached as testSaxonRead.xsl). The output of CLI with  "-explain -t" options (attached as outputWithTimingAndPlan.txt) suggests a tree is built for the doc that is used with saxon:read-once. The execution plan is extracting the call to 'doc' function into a global variable.
I verified that the license is correct by using the saxon:stream function which works fine with the same saxon library. 
Please help. I think I am missing something basic, but honestly, cannot figure it out.
I am using Saxon-EE (evaluation version).

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:

saxon-help mailing list archived at