[Home] [By Thread] [By Date] [Recent Entries]
At 09:53 AM 4/10/2002, you wrote:
The new variable created here is only within the scope of the if-block. </xsl:if> <!-- if i use start_x here it just contains 5 and not 10 --> <xsl:value-of select="$start_x"/> </xsl:template> Use recursion and call your named template with a starting parameter. <xsl:template name="foo">
<!-- Default value of 5 if none given -->
<xsl:param name="start_x" select="5"/>
<xsl:if test="true">
<xsl:call-template name="foo">
<xsl:with-param name="start-x" select="$start_x + 5"/>
</xsl:call-template>
</xsl:if>
<xsl:value-of select="$start_x"/>
</xsl:template>The above template is infinitely recursive because you didn't really provide a purpose for your template. I therefore have no idea what your criteria for stopping is. You'll probably want to add a second param that will get progressively smaller with each recursive call.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



