Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to Talend. I am designing a job to parse xml data. tFileInputXML -> tXMLMap -> tLogRow
I have an part of xml like this below.
<Items>
<anyType xsi:type="Convector">
<Name>Base</Name>
<Weight>1125</Weight>
<OuterDiameter>2</OuterDiameter>
<InnerDiameter>0.61</InnerDiameter>
</anyType>
<anyType xsi:type="Coil">
<Status>Placed</Status>
<Version>1</Version>
<Type>Strict</Type>
</anyType>
<anyType xsi:type="Convector">
<Name>Convector 1</Name>
<Weight>1174</Weight>
<OuterDiameter>2.2</OuterDiameter>
<InnerDiameter>0.93</InnerDiameter>
</anyType>
<anyType xsi:type="Coil">
<Status>NotPlaced</Status>
<Version>2</Version>
<Type>NotStrict</Type>
</anyType>
</Items>
Could some one tell me how i can loop anyType in tXMLMap based on xsi:type = "Convector " or "Coil" and retrieve its child values. i.e If anytype xsi:type = "Convector" then loop
Name, Weight , OuterDiameter, InnerDiameter values and log in tlogRow1 and If anytype xsi:type = "Convector" then loop status, version, type values and log in tlogRow2.
Thanks for the help in advance.
From what I understand, In tXMLMap, set your sourceloop to </anytype>, in the next tmap split the data based on the xsi:type
Can you tell me how do I split the data based on type ?