Hi Guys,
I would like to seek for your expertise.
I have the following source XML format:
<SourceMessage>
<row>
<tax></tax>
<amount></amount>
</row>
<row>
<tax></tax>
<amount></amount>
</row>
<row>
<tax></tax>
<amount></amount>
</row>
</SourceMessage>
For my target message, I have the following XML format:
<TargetMessage>
<TargetSegment>
<amount></amount>
</TargetSegment>
<TargetSegment>
<amount></amount>
</TargetSegment>
<TargetSegment>
<amount></amount>
</TargetSegment>
</TargetMessage>
If my tax field has a value from the source XML, the amount will be produced on the <amount> field under the 3rd occurrence of <TargetSegment>.
And the other <amount> fields which do not have value or null for <tax> will be produced in 1st and 2nd occurrences of <TargetSegment>.
Example:
If my second occurrence of <row> has
<tax>123</tax>
<amount>1234</amount>,
the amount will be produced in the <amount> field under the 3rd occurrence of <TargetSegment>.
How can I create this logic in my mapping?
Thanks and Regards,
Neil