Trying to find a simple way to sum nodes with same values.
for example
<data>
<gldetail>
<ACCOUNTNO><![CDATA[5200]]></ACCOUNTNO>
<AMOUNT><![CDATA[275]]></AMOUNT>
</gldetail>
<gldetail>
<ACCOUNTNO><![CDATA[5200]]></ACCOUNTNO>
<AMOUNT><![CDATA[-475]]></AMOUNT>
</gldetail>
<gldetail>
<ACCOUNTNO><![CDATA[5650]]></ACCOUNTNO>
<AMOUNT><![CDATA[475]]></AMOUNT>
</gldetail>
<gldetail>
<ACCOUNTNO><![CDATA[5650]]></ACCOUNTNO>
<AMOUNT><![CDATA[525]]></AMOUNT>
</gldetail>
</data>
I want to sum all amounts where accountno are the same. so the first two and last two would sum together and spit out the following
<data>
<gldetail>
<ACCOUNTNO><![CDATA[5200]]></ACCOUNTNO>
<AMOUNT><![CDATA[-200]]></AMOUNT>
</gldetail>
<gldetail>
<ACCOUNTNO><![CDATA[5650]]></ACCOUNTNO>
<AMOUNT><![CDATA[1000]]></AMOUNT>
</gldetail>
</data>
I know there is a math sum module that will total them but it doesnt compare, just blindly totals. Is there an easy way with a conditional or something to do this or does it have to be done in a script?