dcsimg
A question about xpath
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   wayne_s
Posted On:   Thursday, February 8, 2007 02:32 PM

Hi, How can I use xpath to get the sum of balance of all the reports that are dated 2006-12-21? Jen 10 2006-12-31 Wendy 12 2006-12-31 Andy 30 2001-12-31 Jen 40 2002-12-31 Jen 50 2003-12-31 Jen 33 2006-12-31 Wendy 22 2006-12-31    More>>

Hi,

How can I use xpath to get the sum of balance of all the reports that are dated 2006-12-21?







Jen

10

2006-12-31





Wendy

12

2006-12-31





Andy

30

2001-12-31





Jen

40

2002-12-31





Jen

50

2003-12-31





Jen

33

2006-12-31





Wendy

22

2006-12-31





   <<Less

Re: A question about xpath

Posted By:   Robert_Lybarger  
Posted On:   Thursday, February 8, 2007 06:48 PM

XSLTs job is *not* to perform math operations on values in your nodes. With that being said, you can write a recursive named template that adds the value in/under the current node with the value of a recursive call for all the following nodes (and return '0' when there are no more nodes) but I haven't the patience to try to bang that all out here. (I've done it once ... it can get somewhat dicey if you aren't in the right frame of mind to attack it.) Your next-best option might be a custom function you plug in, but I've never done that personally. Your next-best option is just to transform the values into a text file (one value per line, for example) and run a utility on that file ... of course you'll say you need this result during the xslt run itself. (In which case, write two xslts: one to dump values you want, another to do the actual transform where you pass the value to the xslt in as a param. Then write a batch/shell script around the whole thing.)
About | Sitemap | Contact