This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: How to access calculation done in loop?


There are two ways to tackle this:

(a) with a recursive template, as in the example on page 502 of my XSLT
Programmers Reference
(b) with two passes; the first pass creates a tree containing the value of
price*qty as a separate attribute, the second pass uses the sum() function
on this tree.

Mike Kay

>
> I am trying to calculate the total price of all the items
> purchased.
> I want to print the total amount outside the for-each loop by
> multiplying price and qty for each item.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]