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

RE: simple summation question

Subject: RE: simple summation question
From: "Martinez, Brian" <brian.martinez@xxxxxxxx>
Date: Mon, 30 Dec 2002 14:26:04 -0700
simple summation
> From: Lee, Insoo [mailto:Insoo.Lee@xxxxxx]
> Sent: Monday, December 30, 2002 2:12 PM
> Subject:  simple summation question
> 
>   Hello - a quick simple question, how would get a subTotal 
> for someValue by
> entity as shown below?
>   I can get a grand total by using sum(/report/entity/row/someValue)..
> 
>   Thanks
> 

The simplest way would be "sum(/report/entity[n]/row/someValue)", where n is
the position of the selected entity element in document order.  If you
wanted to output each subtotal you could do

<xsl:for-each select="/report/entity">
  <xsl:value-of select="sum(row/someValue)"/>
</xsl:for-each>

xsl:apply-templates could also be used in a similar fashion.

hth,
b.

| brian martinez                              brian.martinez@xxxxxxxx |
| senior gui programmer                                  303.708.7248 |
| trip network, inc.                                 fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| http://www.cheaptickets.com/                   http://www.trip.com/ |

 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.