Subject: Re: [xsl] Problem with xslt recursion From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 10 Feb 2004 12:00:34 -0500 |
Hi.. This is my first doubt with this group..hope i get some help..
I have the following xml... <UIComponents> <Component name = "EntrySpecialMessageAddButton"> <ResourceType>Composite</ResourceType> <ResourceTypeSet> <Type>R1</Type> <Type>R2</Type> <Type>R3</Type> </ResourceTypeSet> </Component> </UIComponents>
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 < $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..
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Problem with xslt recursi, Roopesh Kumar | Thread | RE: [xsl] Problem with xslt recursi, Andrew Welch |
Re: [xsl] Problem with xslt recursi, David Carlisle | Date | RE: [xsl] Normalize / Simplify HTML, Andrew Welch |
Month |