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

RE: Summing over nodes belonging to different ns

Subject: RE: Summing over nodes belonging to different ns
From: "Parker, Daniel" <Daniel.Parker@xxxxxxxxxx>
Date: Wed, 25 Oct 2000 11:07:33 -0700
daniel parker
Thank you.  Both work with saxon also.

Regards,
Daniel Parker

-----Original Message-----
From: Don Bruey [mailto:dbruey@xxxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, October 25, 2000 9:20 AM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: RE: Summing over nodes belonging to different ns


This stylesheet computes it two ways.   Works with msxml3.

<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
  xmlns:us="www.us.com"
  xmlns:them="www.them.com"> 

<xsl:template match="summary">
Sum of values for each namespace: 
<xsl:value-of select="format-number(sum(//us:value) + sum(//them:value),
'###,###,##0.00')" /> 
Sum of all 'value' elements regardless of namespace: 
<xsl:value-of select="format-number(sum(//*[local-name() = 'value']),
'###,###,##0.00')" />
</xsl:template>
</xsl:stylesheet> 


 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.