[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSL: How to Calculate Running Total using Variabl
> PROBLEM: I can't figure out how to calculate the BATCHTOTAL. > I think it's because with each loop, the GRANDTOTAL variable > goes out of scope. Without a sample of your xml you make it more difficult to guess, but this sounds like you want to do the first calculation in a variable and then sum that into a grandtotal. For example, Build a variable with your first set of calculations: <xsl:variable name="batchTotals"> <subtotal name="hourly">123</subtotal> <subtotal name="lesser">456</subtotal> </xsl:variable> Then sum what you need from that: <xsl:variable name="grandTotal" select="sum($batchTotals/subtotal)"/> (convert to node-set first in xslt 1.0) Just separate out your operations into variables, with each one working on the last. cheers andrew XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|