[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] Calculating cumulative values
Subject: RE: [xsl] Calculating cumulative values From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Sun, 4 Feb 2007 09:25:11 -0000 |
> You can just use XPath here, no need for recursion: > > <xsl:template match="point"> > <xsl:copy> > <xsl:copy-of select="@*"/> > <xsl:attribute name="y2"> > <xsl:value-of > select="sum(./@y1|preceding-sibling::point[@x = current()/@x]/@y1)"/> > </xsl:attribute> > </xsl:copy> > </xsl:template> > Though that's O(n^2) - a recursive solution might be O(n). Michael Kay http://www.saxonica.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Transforming tabular info, Simon Shutter | Thread | RE: [xsl] Stopping any processing i, Michael Kay |
Re: [xsl] Calculating cumulative va, Mukul Gandhi | Date | Re: [xsl] Calculating cumulative va, Dimitre Novatchev |
Month |
Keywords