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

RE: Problem with xslt recursion

Subject: RE: Problem with xslt recursion
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Tue, 10 Feb 2004 17:09:25 -0000
xslt recursion
> and i have a recursive call to a template whose
> function is to concatenate all the values with the tag
> name Type..(The actual functionality of the template
> is more than what is being described here..which
> cannot be disclosed)
> 
> <xsl:template name="build">
> <xsl:param name="ResourceName"/>
> <xsl:param name="Index"/>
> <xsl:param name="Count"/>
> <xsl:variable name="try">
> <xsl:value-of select ="ResourceTypeSet/Type[$In]"/> 
> </xsl:variable> <xsl:if test="$Index &lt; $Count"> 
> <xsl:call-template name="buildResourceName"> <xsl:with-param 
> name="ResourceName"><xsl:value-of
> select="concat($ResourceName,$TempResource)"/>    
> </xsl:with-param>
> <xsl:with-param name="Index"><xsl:value-of 
> select="$Index+1"/></xsl:with-param>
> 
> <xsl:with-param name="Count"
> select="$Count"></xsl:with-param>
> </xsl:call-template>
> </xsl:if>
> </xsl:template>
> 
> The initial call to the template is as follows 
> 
> <xsl:call-template name="build">
> <xsl:with-param name="ResourceName"/>
> <xsl:with-param name="Index" select="1"/>
> <xsl:with-param name="Count" select="$Count+1"> </xsl:call-template>
> 
> The problem is that for each recursive call to the
> template the value of try remains R1...
> whereas it should have been R1 in the first call..
> R2 for the next call..and R3 for the third cal..
> 
> I wanna know if what i am doing in the template is
> correct..

Unless you show the recursive template there's not much that be done...

Im guessing you are calling the named template multiple times from the
same template, rather than calling the template from itself.  So you
aren't actually using recursion at all.  If you post the template it
should show this :)

cheers
andrew

 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.