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

Setting values for variable

Subject: Setting values for variable
From: "john lee" <excel_man@xxxxxxxxxxx>
Date: Thu, 09 Sep 2004 21:03:40 +0000
values of variable
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]">
   <xsll:choose>
     <xsl:when test="string-length(normalize-space(Payment))!=0">
       <xsl:variable name="pterm" select="$pterm + Payment"/>
     </xsl:when>
   <xsl:otherwise>
      <xsl:variable name="pterm" select="$pterm + 0.02*Balance"/>
   </xsl:otherwise>
  </xsl:choose>
</xsl:for-each>
<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 ?

Thanks

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


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.