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: Repeating a string


I would do something like this:

<xsl:template match="some/node/selection">
	<xsl:call-template name="repeater">
		<xsl:with-param i="20"/>
		<xsl:with-param str="Hello"/>
	</xsl:call-template>
</xsl:template>

<xsl:template name="repeater">
	<xsl:param name="i"/>0</xsl:param> <!-- defaul value-->
	<xsl:if test="$i > 0">
		<xsl:call-template name="repeater">
			<xsl:with-param i="$i - 1"/>
			<xsl:with-param str="$str"/>
		</xsl:call-template>
		<xsl:value-of select="$str"/>	
	</xsl:if>
</xsl:template>

        Cheers,
            Filipe


PS: I have not tested this but I think it would work.


 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]