Subject: Re: [xsl] Problem with filtrate sum From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Thu, 01 Oct 2009 19:20:24 +0200 |
<xsl:template match="root-element"> <table> <xsl:variable name="x"> <xsl:for-each select="Row[position()>=1]"> <d><xsl:value-of select="translate(Number,'.','')"/></d> </xsl:for-each> </xsl:variable> <td><xsl:value-of select="sum(exslt:node-set($x)/d) "/></td> </table> </xsl:template> </xsl:stylesheet>
I would like to sum number (without character '.'). It works. Now I try sum for one name, I make like this but it doesn't work <xsl:value-of select="sum([Name = 'Joe']exslt:node-set($x)/d) "/> How can I filtrate sum with using function translate, or key?
<xsl:variable name="x"> <xsl:for-each select="Row[position()>=1][Name = 'Joe']"> <d><xsl:value-of select="translate(Number,'.','')"/></d> </xsl:for-each> </xsl:variable>
then you would simply compute the sum as before <xsl:value-of select="sum(exslt:node-set($x)/d)"/>
<xsl:variable name="x"> <xsl:for-each select="Row[position()>=1]"> <d> <name><xsl:value-of select="Name"/></name> <value><xsl:value-of select="translate(Number,'.','')"/></value> </d> </xsl:for-each> </xsl:variable>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Problem with filtrate sum, j23 | Thread | Re: [xsl] Problem with filtrate sum, j23 |
[xsl] Problem with filtrate sum, j23 | Date | Re: [xsl] Problem with filtrate sum, j23 |
Month |