Memoryexception on xsl:copy
Added by Anonymous over 15 years ago
Legacy ID: #7453666 Legacy Poster: Michiel van Praat (chielos24)
Hi, I have a large xml file (400 mb) that i would like to process with the following statement: <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> and some other statements in the file (specific node statements) <xsl:template match="X"> <xsl:template match="Y"> etc. got this from http://www.dpawson.co.uk/xsl/sect2/N8367.html#d13028e58 This gives me a memoryexception (using saxonsa9-0-0-2n). Is there a way to write this differently? Or to do this serial? Many thanks
Replies (1)
RE: Memoryexception on xsl:copy - Added by Anonymous over 15 years ago
Legacy ID: #7453701 Legacy Poster: Michael Kay (mhkay)
To run this normally (without streaming) you'll need about 2Gb of memory, which you can allocate on the command line: java -Xmx2048m net.sf.saxon.Transform .... Saxon-SA has streaming facilities which allow you to process large input documents without building the full tree in memory. Details are at http://www.saxonica.com/documentation/sourcedocs/serial.html The new release 9.2 which will very soon go out on beta includes significant extensions to the streaming capabilities for XSLT.
Please register to reply