Below is the input XML and I need to pass the text of node "desc" to target node only when "lang" node is EN if there is no EN present in the GP nodes then whatever language comes first it needs to be passed to target node (see below expected output).
I tried "equal string" and "if" functions to achieve this but failing to achieve, all the false are assigned to non EN and this creates a mess.
I achieved this using groovy scripting but How can I achieve this in Graphical Mapping?
Input XML:
<Root>
<GP1>
<Parent>
<Lang>EN</Lang>
<desc>hello</desc>
</Parent>
<Parent>
<Lang>DE</Lang>
<desc>gutentag</desc>
</Parent>
<Parent>
<Lang>EN</Lang>
<desc>Good morning</desc>
</Parent>
<Parent>
<Lang>EN</Lang>
<desc>Hellothere</desc>
</Parent>
<Parent>
<Lang>DE</Lang>
<desc>Guten Morg</desc>
</Parent>
</GP1>
<GP2>
<Parent>
<Lang>DE</Lang>
<desc>gutentag</desc>
</Parent>
<Parent>
<Lang>HND</Lang>
<desc>Namaskar</desc>
</Parent>
<Parent>
<Lang>SPN</Lang>
<desc>HOLA</desc>
</Parent>
</GP2>
</Root>
The Output should be like this
<Root>
<GP1>
<Parent>
<Title>Hello</Title>
<Title>GoodMorning</Title>
<Title>Hellothere</Title>
</Parent>
</GP1>
<GP2>
<Parent>
<Title>GutenTag</Title>
</Parent>
</GP2>
</Root>