Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2010, 08:47 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default can we do sum like this sum($t)

Hi ,



can we do sum like this sum($t) -- Where $t - is the tag name of my xml


my sample xml:
================
<sample>
<AA>10</AA>
<AA>20</AA>
<AA>30</AA>
<AA>40</AA>
</sample>

xsl
=====
<xsl:for-each select="sample">
<xsl:variable name="t"><xsl:value-of select="'AA'"/></xsl:variable>
<P><xsl:value-of select="sum($t)"/></P>
</xsl:for-each>

so that my out put should be like below

<P>100</P>


kindly advice


Thanks
anil
 
Old March 11th, 2010, 08:51 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

sum(*[name()=$t])
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
anarleti (March 13th, 2010)
 
Old March 13th, 2010, 03:19 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Hi,

I got it.
Thanks for your time and timely response

Regards
Anil





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sum satish_baleri XSLT 6 October 24th, 2007 03:43 AM
Help: Running Sum (or Cumulative Sum) timdasa VB Databases Basics 1 August 22nd, 2006 03:12 PM
Sum Jonas Access VBA 1 August 4th, 2006 12:41 PM
need sum help! jbik BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 December 20th, 2004 05:27 PM
SUM or What bertlf Pro VB Databases 2 November 29th, 2003 02:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.