Re: [xsl] Calculating cumulative values

Subject: Re: [xsl] Calculating cumulative values
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Sat, 3 Feb 2007 14:58:34 -0800
On 2/3/07, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
> If I needed to perform a sort on x and y1 first, could I do it in the same
> stylesheet?

The solution I provided doesn't require any sort.



Actually some sort is required :o)


An xsl:sort instruction has to be added to the important part of the
code in this way:


<xsl:for-each-group select="point" group-by="@x"> <xsl:sort select="current-grouping-key()" data-type="number"/> <xsl:for-each select="f:scanl1(f:add(), current-group()/@y1)"> <point x="{current-group()[1]/@x}" y="{.}"/> </xsl:for-each> </xsl:for-each-group>


-- Cheers, Dimitre Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence. --------------------------------------- To invent, you need a good imagination and a pile of junk ------------------------------------- You've achieved success in your field when you don't know whether what you're doing is work or play

Current Thread