04-18-06 05:46 AM
OK, here's what I want to do. Input (not the actual input, but similar
structure):
<Pallet>
<Items>
<Item>
<Reference>0001</Reference>
<Qty>5</Qty>
</Item>
<Item>
<Reference>0001</Reference>
<Qty>5</Qty>
</Item>
<Item>
<Reference>0002</Reference>
<Qty>5</Qty>
</Item>
<Item>
<Reference>0003</Reference>
<Qty>5</Qty>
</Item>
</Items>
</Pallet>
<Pallet>
<Items>
<Item>
<Reference>0001</Reference>
<Qty>5</Qty>
</Item>
<Item>
<Reference>0002</Reference>
<Qty>5</Qty>
</Item>
</Items>
</Pallet>
Now, what I wish to do is map this into the following:
<LineItem>
<Reference>0001</Reference>
<Qty>15</Qty>
</LineItem>
<LineItem>
<Reference>0002/Reference>
<Qty>10/Qty>
</LineItem>
<LineItem>
<Reference>0003/Reference>
<Qty>5</Qty>
</LineItem>
Basically, I want to collect the quantities by Reference and stick into an
output format that has a single Reference segment for each reference #
(0001,0002 etc). The source can have any number of Item segments
referencing the same #, nested in various Pallets... what I can't figure out
is how to create only one Reference entry on the target side.. I figure that
if I can somehow pull a unique Reference out of the source map I could use
some cumulative functoids together with logical Equal to only sum up the
quantities for the given reference.
But I am lost.. help!
thanks,
Christer
[ Post a follow-up to this message ]
|