An update on this: oXygen compiles the XSLT code with a Saxon option set that inserts debugging/trace code into the compiled stylesheet. This code is preventing the optimizations that cause streaming to work. I will work with the oXygen people to try and find a way around this.

Michael Kay

On 12/03/2012 14:59, Todd Gochenour wrote:
I'm running with oXygen Developer version 13.2 with Saxon-EE  There is no timing option in the configuration dialog page.  My code is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.1"

<xsl:template match="/">
<xsl:for-each select="saxon:stream(doc('test7.xml')/*/*/table_data)">
<xsl:variable name="table-name" select="@name"/>
<xsl:variable name="collection-uri" select="concat('db/',parent::*/@name,'/',$table-name)"/>
<xsl:for-each select="row">
<xsl:variable name="record">
<xsl:element name="{$table-name}">
<xsl:for-each select="field[@name]">
<xsl:element name="{if(number(substring(@name,1,1))=number(substring(@name,1,1))) then concat('_',@name) else @name}">
<xsl:value-of select="text()"/>
<xsl:variable name="id" select="if($record/*/id) then concat('id-',$record/*/id) else concat('ndx-',position())"/>
<xsl:result-document href="{$collection-uri}/{$id}.xml">
<xsl:copy-of select="$record"/>

This code functions on a file that is 112Megs in size.  It fails on a file that is 527Megs in size. The original export file is 704Megs in size.  The second and third files contain the xsi:type attribute which I've cast the xsi and xs namespaces to dummy hrefs.  A file of 485KB succeeds with these dummy attributes present.  The oXygen debug steps through the stream() function to the doc() function before spinning for a bit and then throwing the Java heap space exception.
I have yet to figure out how to extract Saxon from oXygen so as to run in command line mode.  I guess figuring this out is my next task.

Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!

saxon-help mailing list archived at