|
Subject: Re: [xsl] xsl:variable ? From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx> Date: Wed, 10 Apr 2002 10:21:56 -0600 |
<xsl:template name="foo">
<xsl:variable name="start_x" select="5"/>
<xsl:if test="true">
<!-- use the variable and add to it -->
<xsl:variable name="start_x" select="10"/>
</xsl:if> <!-- if i use start_x here it just contains 5 and not 10 --> <xsl:value-of select="$start_x"/> </xsl:template>
I have read that xsl:variables are constant so it would seem that I can not change the value of my variable, but if this is the case then how can I work around this problem? I need to store a value to use it later and manipulate the variable?!
<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>
Greg Faron Integre Technical Publishing Co.
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] xsl:variable ?, Jeni Tennison | Thread | [xsl] date, Carlos |
| Re: [xsl] xsl:variable ?, Jeni Tennison | Date | [xsl] applying templates to ancesto, Jarom McDonald |
| Month |