This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how print number from 1 to N


Андрей Солончук 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]