Re: [xsl] counting loop in xslt

Subject: Re: [xsl] counting loop in xslt
From: Antonio Fiol <fiol@xxxxxxxxxx>
Date: Tue, 28 May 2002 10:33:22 +0200
Pfitzner, Jan wrote:

for (int a; a <= number;;a++){}


Once a variable is defined, you cannot change its value. However, you can use recursive template calls like (not tested, may well not work):

<xsl:variable name="number">10</xsl:variable>

<xsl:template name="loop">
<xsl:param name="a" select="0" />
<!-- Use your a -->
<xsl:value-of select="$a">
<!-- Test condition and call template if less than number -->
<xsl:if test="$a < $number">
<xsl:call-template name="loop">
<xsl:with-param name="a" value="{$a + 1}" />

I insist, this has not been tested.


XSL-List info and archive:

Current Thread