Hi everyone I need your help! I have been working on a code that will get the total weight of every unique product id that belong to a second level loop. Here's the code I am using. But the output I am getting is 110, which should be 60 only. Thank you in advance!
<xforms:bind calculate="sum(instance('Generated')/page1/table1/item[sublinesA[not(sublineA/prodid = preceding-sibling::sublinesA/sublineA/prodid)]]/sublinesA/sublineA[not(prodid = preceding-sibling::sublineA/prodid)]/weight)" nodeset"instance('Generated')/page1/table1/totalwgt"></xforms:bind>
<item>
<sublinesA>
<sublineA>
<prodid>AAA</prodid>
<weight>10</weight>
</sublineA>
<sublineA>
<prodid>AAA</prodid>
<weight>10</weight>
</sublineA>
<sublineA>
<prodid>BBB</prodid>
<weight>20</weight>
</sublineA>
</sublinesA>
</item>
<item>
<sublinesA>
<sublineA>
<prodid>BBB</prodid>
<weight>20</weight>
</sublineA>
<sublineA>
<prodid>BBB</prodid>
<weight>20</weight>
</sublineA>
<sublineA>
<prodid>CCC</prodid>
<weight>30</weight>
</sublineA>
</sublinesA>
</item>
<item>
<sublinesA>
<sublineA>
<prodid>CCC</prodid>
<weight>30</weight>
</sublineA>
</sublinesA>
</item>