[xsl] xsl recursion

Subject: [xsl] xsl recursion
From: Norman Barker <normanb@xxxxxxxxxxxxx>
Date: Wed, 23 Feb 2005 15:46:14 +0000
I am using Xalan and Cocoon to doing try and implement a "divide and conquer" algorithm for processing very
large XML files. I have a row count of 8400, so I should only have a depth of log2(8400) (about 12), I keep getting
stack overflow error, and setting -RL with Xalan fails too, I thought DVC algorithms were supposed to stop this!



and the template looks like
where rows are the collection of sql:row above
Any help would be great, thanks,

<xsl:template name="data">
<xsl:param name="rows"/>
<xsl:param name="rowcount" select="count($rows)"/>
<xsl:when test="$rowcount = 1">
<xsl:for-each select="sql:row">
<xsl:for-each select="*">
<xsl:when test="(local-name(.) = 'date') or (local-name(.) = 'lat') or (local-name(.) = 'lon')"></xsl:when>
<xsl:value-of select="."/>
<xsl:variable name="cntHalf"
select="floor($rowcount div 2)"/>
<xsl:variable name="vValue1">
<xsl:call-template name="data">
<xsl:with-param name="rows"
select="$rows[position() &lt;= $cntHalf]"/>
<xsl:variable name="vValue2">
<xsl:call-template name="data">
<xsl:with-param name="rows"
select="$rows[position() > $cntHalf]"/>
</xsl:variable> </xsl:otherwise>

Current Thread