sum values in xsl

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi, i have an xml where i there is a field that i have to sum, the problem is that when using:
<xsl:value-of select="sum(//activity[contains(sponsors/sponsor/sponsor-name,ITALY MAE)] /sponsors/sponsor/amount)" /> the sum is not complete.
I tried to sum the values but i cant sum them
<xsl:variable name="totalItalyMae" /><br/>
<xsl:for-each select="//sponsors/sponsor
<br/>
<xsl:if test="contains(sponsor-name,ITALY MAE) <br/>
<xsl:variable name="PartialItalyMae" select= "amount" /><br/>
</xsl:if>
<br/>
</xsl:for-each>
with this cycle i can get the right values but i cant sum them because totalItalyMae doesnt change when i add values.
Is there any way to sum this values.
Thank you.

View the full article
 
Back
Top