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

RE: sum a selected tag of a key

Subject: RE: sum a selected tag of a key
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Thu, 18 Mar 2004 14:01:44 -0000
xsl key sum

> Hi everybody and thanks for the latest response,
> 
> I have  created a key 
> <xsl:key name="detalleanno" 
> match="/PENSIONES/DETALLE_PENSION" 
> use="/PENSIONES/DETALLE_PENSION/ANNO" /> I would like to get 
> the sum of APORT_EMP during a year. I am trying with the 
> following expression: <xsl:value-of 
> select="sum(key('detalleanno',ANNO)/APORT_TRAB)"/>, but i 
> always get the sum of all the years and i only want the 
> values of a year. Could anyone give me an advice? thanks

The 'use' attribute of xsl:key is relative to the 'match' attribute, so
you will need to use:

<xsl:key name="detalleanno" match="/PENSIONES/DETALLE_PENSION"
use="ANNO" />

cheers
andrew 

 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.