xsl-list
[Top] [All Lists]

Re: [xsl] Processing node-sets in batches

2010-03-07 18:04:21
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




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>