Re: [xsl] recursive loop in XSL stylesheet is failing

Subject: Re: [xsl] recursive loop in XSL stylesheet is failing
From: George <news.net@xxxxxxx>
Date: Thu, 25 Mar 2010 14:31:19 +0100
Thanks, David.

You are right, I do not want that the two params hold the same value.

So, I guess instead of
...
<xsl:template match="Entry">
<xsl:variable name="catid" select="CategoryID"/>
<xsl:param name="parentcatid" select="document('Categories.xml')/Categories/Category[@ID=$catid]/@ParentID"/>
<xsl:param name="parentcat"><xsl:value-of select="CategoryName"/></xsl:param>
<xsl:call-template name="ParentCategories">
<xsl:with-param name="parentcatid" select="."/>
<xsl:with-param name="parentcat" select="."/>
</xsl:call-template>
...


I have to put it like that
...
<xsl:template match="Entry">
<xsl:variable name="catid" select="CategoryID"/>
<xsl:call-template name="ParentCategories">
<xsl:with-param name="parentcatid" select="document('Categories.xml')/Categories/Category[@ID=$catid]/@ParentID"/>
<xsl:with-param name="parentcat" select="select="CategoryName""/>
</xsl:call-template>
...


How can I update a var with each cycle of the iterative loop?
It should be something like:
$i = $i + ''

Thanks in advance.
George

Current Thread