I'm attempting to concatenate two element values into one from a series of child items like the below XML block. My XPath expression is working correctly and gives the correct number of items in the list. But when I try to use the CurrentItem in this list to Get or Set an XML Element Value it uses the first record in the list instead of the current one. However using Insert XML with the same CurrentItem variable inserts the correct one.
<transportInstructionConsignmentItem>
<lineItemNumber>1</lineItemNumber>
<transportCargoCharacteristics>
<cargoTypeCode>14</cargoTypeCode>
<cargoTypeDescription languageCode="en">TypeDescription</cargoTypeDescription>
<totalPackageQuantity>4</totalPackageQuantity
<totalItemQuantity>2.0</totalItemQuantity>
</transportCargoCharacteristics>
<handlingInstruction>
<transportTemperature>
<maximumTemperature>4.00</maximumTemperature>
<minimumTemperature>4.00</minimumTemperature>
</transportTemperature>
</handlingInstruction>
<logisticUnit>
<packageTypeCode>Type</packageTypeCode>
<tradeItemQuantity>100</tradeItemQuantity>
<tradeItemReference>ItemRef</tradeItemReference>
<tradeItemDescription>Test</tradeItemDescription>
</logisticUnit>
</transportInstructionConsignmentItem>Doing the exact same thing with loop and another XPath on the node list using the LoopIndex works as expected.
Is this a bug, or am I using the For Each wrong? I feel like it should work and it's weird that the different XML actions are point to different variables. Any ideas?

Report
All responses (
Answers (