Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

XPath concat multiple nodes

I have the following xml as source.I need to concate the subEl1 and subEl2.

<item>
<element1>el1</element1>
<element2>el2</element2>
<element3>el3</element3>
<element4>
<subEl1>subel1a</subEl1>
<subEl2>subel2a</subEl2>
</element4>
<element4>
<subEl1>subel1b</subEl1>
<subEl2>subel2b</subEl2>
</element4>
</item>
The output should be "subel1a subel2a"
Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hi
Use a tFileInputXml to extract the records from the xml file and concate the two columns into one column on tMap, please see my screenshots.
Best regards
Shong
Anonymous
Not applicable
Author

Thanks Shong.There are some case where the sub element occurence is more than two or in some with one.What will i do in this scenario?
<item>
<element1>el1</element1>
<element2>el2</element2>
<element3>el3</element3>
<element4>
<subEl1>subel1a</subEl1>
<subEl2>subel2a</subEl2>
<subEl3>subel3a</subEl3>
</element4>
<element4>
<subEl1>subel1b</subEl1>
<subEl2>subel2b</subEl2>
</element4>
<element4>
<subEl1>subel1b</subEl1>
</element4>
</item>
Anonymous
Not applicable
Author

Hi
You should extract all the fields from the xml file, that means you always extract the max number of fields, maybe some of fields could be empty in output because the element occurence is more than two or in some with one.
Best regards
Shong