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

generating totals

Subject: generating totals
From: "Corey Wilson" <corey@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Jun 2003 13:03:36 -0400
xsl totals
I have a rather large xml and I am trying to calculate some totals.  I have
to go through the whole file once listing the information for each client...
then after i have been though the file, I need to print the totals... If I
were using a different language, i would just keep up with the totals so far
in a variable.. but the only way I have come up with doing it in xsl is
going through the file, then at the end, doing a sum of the values i need to
add... This would be ok, but the file is so large, it takes a long time for
it to go through the file again.. Anyone have any suggestions?

XML Layout
<client>
<name />
<phone />
<price />
</client>

Pseudo-XSL (current)
<for-each client>
print name, phone, price
</for-each>
total = <value-of sum(//client/price)>

my xml file is a great deal more involved than I have listed, but I think my
example explains my situation correctly.

Pseudo-XSL (desired)
<for-each client>
print name, phone, price
<remember total so far???>
</for-each>
print total

Thanks for any help!!!


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.