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.)