Re: [xsl] Processing node-sets in batches

Subject: Re: [xsl] Processing node-sets in batches
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 08 Mar 2010 00:04:06 +0000
On 07/03/2010 23:50, Jeff Hooker wrote:
so I'm trying to read all of the nodes into a node-set() and process them out into a series of 100-row tables.

if you need the node-set() extension then probably you have copied the entire source into a result tree fragment, which might account for your
memory problems. hard to say. But that may not be what you mean (node-set() isn't valid xpath syntax so I'm having to guess)


I'm assuming you are using xslt 1 (you don't say) as xslt 2 doesn't have node sets.

If $x contains a node set then

<xsl:for-each select="$x[position() mod 100 = 1]">
<xsl:variable name="p" select="position()"/>
<xsl:for-each select="$x[position()&gt; $p * 100][position()&lt;= ($p+1) * 100]">


will process the nodes in batches of a hundred

David

Current Thread