homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Gold Sponsor 2015!
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

XSLT Sum help

5+ Year Member

Msg#: 4108542 posted 8:32 pm on Apr 1, 2010 (gmt 0)

I need help getting the sum of two attributes
<xsl:for-each select="Books/Book/price[@currency='Euros']" >
<xsl:value-of select="."/>
<xsl:for-each select="Books/Book" >
<xsl:value-of select="sum(/price[@currency='Euros'])"/>


I'm trying to sum the Euro's, but it is only showing 0's.
What am i missing?



WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4108542 posted 6:18 am on Apr 3, 2010 (gmt 0)

the sum() syntax looks right, so it must be something wrong with the XPATH

without the "/" at the beginning

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved