Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 2nd, 2008, 02:00 PM
Authorized User
 
Join Date: Jun 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default sum function

I need to add all BillingDetails/Amount. Does the sum function recognize -1000.00 (negative numbers)?

sum(BillingDetails/Amount)

<BillingDetails>
      <StatementType>string</StatementType>
      <Amount>11393.17</Amount>
</BillingDetails>
<BillingDetails>
      <StatementType>string</StatementType>
      <Amount>14393.17</Amount>
</BillingDetails>
<BillingDetails>
      <StatementType>string</StatementType>
      <Amount>-1000.17</Amount>
</BillingDetails>
 
Old January 2nd, 2008, 02:07 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Yes, if it doesn't in your case then you need to show your code, the context node maybe incorrect for the XPath you're using.

--

Joe (Microsoft MVP - XML)
 
Old January 2nd, 2008, 05:51 PM
Authorized User
 
Join Date: Jun 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. It was indeed a context issue.






Similar Threads
Thread Thread Starter Forum Replies Last Post
sum() function felixm_jr Reporting Services 1 April 22nd, 2007 01:59 AM
Xpath: sum function gracehanh XSLT 13 September 27th, 2005 09:30 AM
sum function problem sherr8 Access 1 February 13th, 2004 03:06 PM
SUM Function jmss66 Classic ASP Basics 17 July 29th, 2003 08:00 AM
Need Help with the Sum Function athanatos XSLT 1 July 22nd, 2003 10:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.