To do streaming, you will need to make changes to your stylesheet. At the very least you need to declare it streamable by adding
which will cause Saxon to check that the code in the stylesheet is actually streamable. If you're lucky, no further changes will be needed, but it's much more likely that you will need to make some changes to fit with the constraints that streaming imposes.
If the initial mode is declared streamable, then you can run a streaming transformation from the command like using exactly the example you've given - you don't need xsl:stream.
If you don't want to modify the existing stylesheet, you can always add a wrapper module:
Re: Command line example to transform huge file using stream with saxon-EE
> On 7 Sep 2016, at 13:24, Vincent Cestmois <[hidden email]> wrote:
> Many thanks Michael,
> I'll try to modify the Xslt as I don't know where to add the wrapper you provided
> Interestingly, 3 hours ago, while doing my research, I launched the command but with -xsltversion:3.0 flag.
> And it's still crunching without errors, but before I tried it without that 3.0 flag and it failed due to heap space
> java -jar /SaxonEE9-7-0-8J/saxon9ee.jar -xsl:MyXSLT.xslt -s:Source.xml -xsltversion:3.0
> So does 3.0 tries streaming by default (I thought it does not) ?
I would suggest adding -t to the command line as you will then get very quick feedback on whether streaming is being attempted or not.
But Saxon won't attempt streaming unless you ask for it somewhere.