[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How can I simulate a replicate-function in xsl: re

Subject: Re: How can I simulate a replicate-function in xsl: replicate('abc',3)-> 'abcabcabc'
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 14 Mar 2002 11:22:57 +0100
replicate xml xsl
<xsl:template name="replicate">
    <xsl:param name="string" select="'default'"/>
    <xsl:param name="count" select="1"/>
    <xsl:if test="count > 0">
        <xsl:value-of select="$string"/>
        <xsl:call-template name="replicate">
            <xsl:with-param name="string" select="$string"/>
            <xsl:with-param name="count" select="$count - 1"/>
        </xsl:call-template>
    </xsl:if>
</xsl:template>

use it like the following:

<xsl:template match="/">
    <xsl:call-template name="replicate">
        <xsl:with-param name="string" select="'abc'"/>
        <xsl:with-param name="count" select="3"/>
    </xsl:call-template>
</xsl:template>

Regards,
Joerg

Rene de Vries wrote:
Hi,

Can you tell me how to simulate a replicate-function in xsl:
replicate('abc',3) -> 'abcabcabc'

Greetings René
   {@   @}
      ^
     \_/

"You don't need eyes to see, you need vision!"


--

System Development
VIRBUS AG
Fon  +49(0)341-979-7411
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.