This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: how print number from 1 to N
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sat, 05 Oct 2002 15:12:29 +0300
- Subject: Re: [xsl] how print number from 1 to N
- Organization: Multiconn International Ltd
- References: <1686049568.20021005134217@ibis.odessa.ua>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Андрей Солончук wrote:
May be some body know, How to print-out in xsl numbers from 1 to N?
I simply want to generate
<tr>
<td>1</td>
<td>...</td>
<td>N</td>
</tr>
Usual approach is to use recursive template like this one:
<xsl:template name="td-gen">
<xsl:param name="index" select="0"/>
<xsl:if test="$index>0">
<td>...</td>
<xsl:call-template name="td-gen">
<xsl:with-param name="index" select="$index - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
--
Oleg Tkachenko
eXperanto team
Multiconn International, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list