[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Keeping a running total? (Redo)
On 7/11/06, Steve <subsume@xxxxxxxxx> wrote:
I will cross that bridge when I get to it. I'm having a hard enough time getting help for the first problem. Then here's the running-total part: This xslt transformation: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="http://fxsl.sf.net/" exclude-result-prefixes="f" <xsl:import href="../f/func-scanl.xsl"/> <xsl:import href="../f/func-Operators.xsl"/> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:template match="/"> <xsl:for-each select="f:scanl1(f:add(), /*/*/@capacity)"> <xsl:value-of select="concat(., ', ')"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> when applied against the provided source xml document: <xml> <factory x="A" capacity = "3" /> <factory x="B" capacity= "5" /> <factory x="C" capacity = "3" /> <factory x="D" capacity = "2" /> <factory x="E" capacity = "2" /> ...etc... </xml> produces the wanted result (the list of running totals): 3, 8, 11, 13, 15,
|
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
|