AnsweredAssumed Answered

Changing the XML format issue

Question asked by gouthamr388096 on Dec 1, 2017
Latest reply on Dec 4, 2017 by gouthamr388096

I am trying to convert the following XML to the one shown second. I am having hard time getting it to work.

<xml>
<ShipMethod>RW</ShipMethod>
<ShipDate>20171201</ShipDate>
<TrackingNo></TrackingNo>
<CustOrder>SO1196-00002232</CustOrder>
<items>
<pos>
<position>000003</position>
</pos>
<pos>
<position>000004</position>
</pos>
<pos>
<position>000005</position>
</pos>
<item>
<Quantity>3.000</Quantity>
</item>
<item>
<Quantity>2.000</Quantity>
</item>
<item>
<Quantity>1.000</Quantity>
</item>
</items>
</xml>
I want this to be changed to the following.
<xml>
<ShipMethod>RW</ShipMethod>
<ShipDate>20171201</ShipDate>
<TrackingNo></TrackingNo>
<CustOrder>SO1196-00002232</CustOrder>
<items>
<item>
<key>000003</key>  -
<Quantity>3.000</Quantity>
</item>
<item>
<key>000004</key>  -
<Quantity>2.000</Quantity>
</item>
<item>
<key>000005</key>  -
<Quantity>1.000</Quantity>
</item>
</items>
</xml>

Outcomes