RE: [xsl] Adding Variables

Subject: RE: [xsl] Adding Variables
From: "Ranjan K. Baisak" <ranjanbaisak@xxxxxxxxx>
Date: Mon, 28 Jun 2004 04:15:59 -0700 (PDT)
<xsl:variable name="nodecount"
select='format-number($nodecount1+$nodecount2+$$nodecount3,"##########")'/>

for adding numbers

--- Ben Gazzard <BenG@xxxxxxxxxxxxxx> wrote:
> <xsl:variable name="num1">
> 	<xsl:value-of select="//test1/somevalue1"/>
> </xsl:variable>
> 
> <xsl:variable name="num2">
> 	<xsl:value-of select="//test2/somevalue2"/>
> </xsl:variable>
> 
> <xsl:variable name="result" select="$num1 + $num2"
> />
> 
> <xsl:value-of select="$result"/>
> 
> should do the trick...
> 
> Cheers,
> Ben
> 
> -----Original Message-----
> From: John Dwyer [mailto:johnadwyer@xxxxxxxxx]
> Sent: 28 June 2004 11:57
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Adding Variables
> 
> 
> Hi All,
> I've created a number of xsl variables in my
> template
> and I now wish to add these variables together and
> render the result in my template. For example,
> 
> <xsl:variable name="num1">
> <xsl:value-of select="//test1/somevalue1"/>
> </xsl:variable>
> 
> and
> 
> <xsl:variable name="num2">
> <xsl:value-of select="//test2/somevalue2"/>
> </xsl:variable>
> 
> Trying <xsl:value-of select="$num1+$num2"/> doesn't
> work.
> 
> How can I add the results of my two variables above
> and render the result in my template using a
> xsl:value-of or similar.
> Many thanks in advance.
> JD
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail 
> 
>
--+------------------------------------------------------------------
> XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to:
> http://lists.mulberrytech.com/xsl-list/
> or e-mail:
> <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> This e-mail and any attached files are for the
> exclusive use of the addressee and may contain
> privileged and/or confidential information. If you
> receive this e-mail in error you should not disclose
> the contents to any other person nor take copies but
> should delete it and telephone us immediately on
> +44(0)20 7557 6100.
> 
> TEQUILA\ London Limited does not make any warranty
> as to the accuracy or completeness of this e-mail
> and we accept no liability for its content or use.
> Any opinions expressed in this e-mail are those of
> the author and do not necessarily reflect the
> opinions of TEQUILA\ London Limited.
> 
> TEQUILA\ London Limited operates within the
> parameters set by the Data Protection Act 1998 with
> regard to the use of personal information including
> e-mail addresses. We accept no liability for the
> forwarding of this e-mail to other parties that may
> result in unsolicited e-mails being received by
> those whose email addresses appear in this e-mail.
> 
>
--+------------------------------------------------------------------
> XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to:
> http://lists.mulberrytech.com/xsl-list/
> or e-mail:
> <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Current Thread