Thank you all for taking the time to view my problem.
I am having trouble summing the node when the nodes value is different, but works if it is the same.
Here is my XML -
<statement>
<agency>
<employerShareAmt>75.00</employerShareAmt>
</agency>
<agency>
<employerShareAmt>76.00</employerShareAmt>
</agency>
</statement>
Here is my XSLT -
<xsl:template match="/">
<root>
<xsl:call-template name="shopData"/>
</root>
</xsl:template>
<xsl:template name="shopData">
<RESULT>
<xsl:call-template name="sum"/>
</RESULT>
</xsl:template>
<xsl:template match="node()|@*" name="sum">
<xsl:apply-templates select="node()|@*"/>
</xsl:template>
<xsl:template match="statement">
<agency>
<xsl:for-each-group select="agency"
group-by="employerShareAmt">
<employerShareAmt>
<xsl:value-of
select="sum(current-group()/employerShareAmt)"/>
</employerShareAmt>
</xsl:for-each-group>
</agency>
</xsl:template>
The result is 75 76. But if both were 75, the result would be 150.
I seems that it is grouping by value then adding them. How can I get it to group by it's node so the above XML result will be 151?