This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Repeating something "n" times.
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: Repeating something "n" times.
- From: "Evan Lenz" <elenz at xyzfind dot com>
- Date: Mon, 6 Nov 2000 17:38:49 -0800
- Reply-To: xsl-list at mulberrytech dot com
You'd have to use a recursive named template like the following:
<xsl:template name="line-breaks">
<xsl:param name="number"/>
<xsl:if test="number($number) > 0">
<br/>
<xsl:call-template name="line-breaks">
<xsl:with-param name="number" select="number($number) - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Hope this helps!
Evan Lenz
elenz@xyzfind.com
-----Original Message-----
From: owner-xsl-list@mulberrytech.com
[mailto:owner-xsl-list@mulberrytech.com]On Behalf Of robert@elastica.com
Sent: Monday, November 06, 2000 4:28 PM
To: xsl-list@mulberrytech.com
Subject: Repeating something "n" times.
How do I repeat something 'n' times without a node list with n elements?
I just want to determine how many <BR>'s I output by a passed in number
via call-template
I guess the question is
given a number how do I generate a node set with that many elements?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list