I have a big XML file (6 GB) with this kind of tree:
<Report>
<Document>
<documentType>E</documentType>
<person>
<firstname>John</firstname>
<lastname>Smith</lastname>
</person>
</Document>
<Document>
[...]
</Document>
<Document>
[...]
</Document>
[...]
</Report>
If I apply an XSLT style sheet on it, I have this error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
So I wanted to try the new XSLT 3.0 feature: streaming, with Saxon 9.6 EE. I don't want to have the streaming constrains once in a Document. I think that, what I want to do, is very close to the "burst mode" that is described here: http://saxonica.com/documentation/html/sourcedocs/streaming/burst-mode-streaming.html
Here is my Saxon command line:
java -cp saxon9ee.jar net.sf.saxon.Transform -t -s:input.xml -xsl:stylesheet.xsl -o:output/output.html
Here is my XSLT style sheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
<xsl:mode streamable="yes" />
<xsl:template match="/">
GLOBAL HEADER
<xsl:iterate select="copy-of()/Report/Document" >
DOC HEADER
documentType: <xsl:value-of select="documentType"/>
person/firstname: <xsl:value-of select="person/firstname"/>
DOC FOOTER
<xsl:next-iteration/>
</xsl:iterate>
GLOBAL FOOTER
</xsl:template>
</xsl:stylesheet>
But I still have the same out of memory error.
Thank you for your help!