I need to group qty based on same itemid. Header should appear as it is.
This XSLT will be used in BizTalk 2010. Any help would be very much appreciated.
I am using these XML and XSLT in BizTalk 2010 hence XSLT ver 2.0 is not supported
I have seen so many examples but not working for me nor I'm making mistakes.
Here is my input
<Invoice>
<LineHeader>
<ContractorID>1</ContractorID>
<ContractorName>XXX</ContractorName>
<InvoiceDate>1999-05-31</InvoiceDate>
<GSTCode>AUS</GSTCode>
</LineHeader>
<LineItems>
<LineItem>
<ItemID>1</ItemID>
<Qty>10</Qty>
</LineItem>
<LineItem>
<ItemID>2</ItemID>
<Qty>20</Qty>
</LineItem>
<LineItem>
<ItemID>1</ItemID>
<Qty>-3</Qty>
</LineItem>
</LineItems>
</Invoice>
My output should be
<Invoice>
<LineHeader>
<ContractorID>1</ContractorID>
<ContractorName>XXX</ContractorName>
<InvoiceDate>1999-05-31</InvoiceDate>
<GSTCode>AUS</GSTCode>
</LineHeader>
<LineItems>
<LineItem>
<ItemID>1</ItemID>
<Qty>7</Qty>
</LineItem>
<LineItem>
<ItemID>2</ItemID>
<Qty>20</Qty>
</LineItem>
</LineItems>
</Invoice>
There are three line items in input, but only two in output. ItemID 1 is grouped and qty is calculated as 10