[xsl] Setting values for variable

Subject: [xsl] Setting values for variable
From: "john lee" <excel_man@xxxxxxxxxxx>
Date: Thu, 09 Sep 2004 21:03:40 +0000
Dear All,

How do you set a value for a variable without declaring the name of the variable twice.
This is what I intend to do.

<xsl:variable name="pterm" select="0"/>
<xsl:for-each select="$lstAccount[Account_Type=$grpRecord]">
     <xsl:when test="string-length(normalize-space(Payment))!=0">
       <xsl:variable name="pterm" select="$pterm + Payment"/>
      <xsl:variable name="pterm" select="$pterm + 0.02*Balance"/>
<xsl:value-of select="$pterm"/>

But this will generate error since pterm is declared more than once.
Anybody know what's the other way around this ?


The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

Current Thread