This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to access calculation done in loop?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] How to access calculation done in loop?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Fri, 2 Feb 2001 09:37:35 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
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