Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 13th, 2009, 11:06 AM
Registered User
 
Join Date: Jan 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT recursive Additions

Recursive Addition
Hey all,
I need some procedure that can add the value of a specific node recursive.
In other words I need something that could do following:-

var a;

for (int i=0;i<count;i++)
{
a = a + value of (xslt node)
}
print a;

Thankx
Reply With Quote
  #2 (permalink)  
Old January 13th, 2009, 11:11 AM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Do you want to use XSLT 1.0 or 2.0?
Are you aware that even XSLT/XPath 1.0 has a function named 'sum' http://www.w3.org/TR/xpath#function-sum so you might simply be able to use
Code:
<xsl:value-of select="sum(foo)"/>
where foo is the name of the elements you want to sum up.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote
  #3 (permalink)  
Old January 13th, 2009, 11:41 AM
Registered User
 
Join Date: Jan 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope. Never knew abt that. But 3 CHeers. it solved my problem.

Thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No additions using VBA and SQL Bob Pierce Access VBA 1 February 6th, 2007 01:20 PM
Showing 5 latest additions, problem with sorting Konfu XSLT 0 March 11th, 2006 10:21 AM
textboxes and additions toiletgraffiti C# 4 January 23rd, 2006 11:50 AM
recursive XSLT Help boates XSLT 2 January 11th, 2006 03:50 PM
Access 2000 "Open ODBC SQL Table for Additions" cjdphlx Access VBA 3 July 18th, 2005 02:05 PM



All times are GMT -4. The time now is 03:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.