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

help with recursive counter in xsl

Subject: help with recursive counter in xsl
From: "Mikael Petterson \(KI/EAB\)" <mikael.petterson@xxxxxxxxxxxx>
Date: Thu, 9 Feb 2006 13:44:22 +0100
xsl with param counter
Hi,

I call the sequenceNameString template with:

  <xsl:when test="child::*[name() = 'sequence']">
    <xsl:call-template name="sequenceNameString">
    <xsl:with-param name="sequenceName" select="@name"/>
    <xsl:with-param name="maxCount" select="sequence/maxLength"/>
    <xsl:with-param name="value" select="0"/>
  </xsl:call-template></xsl:when>

I can check that the parameter values are sent to the template.
However the incrementation of value does not happen.

I get the following only once( example):

eAgchCodes_name0

but want:

 eAgchCodes_name0
 eAgchCodes_name1
 eAgchCodes_name2
......

Any ideas why?

cheers,

//Mikael

!-- Template that create "<sequencename>_name0",
"<sequencename>_name1"..-->
<xsl:template name="sequenceNameString">
    <xsl:param name="sequenceName"/>
        <xsl:param name="maxCount"/>
        <xsl:param name="value"/>
    <xsl:param name="arrayMax" select="$maxCount - 1"/>
    <xsl:if test="$value &lt; $arrayMax">
        <xsl:value-of
select="concat(concat($sequenceName,'_name'),$value)"/>
        <xsl:call-template name="sequenceNameString">
            <xsl:with-param name="value" select="$value + 1"/>
        </xsl:call-template>
    </xsl:if>
</xsl:template>

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.