
Anonymous
Not applicable
2011-11-30
07:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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"
<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"
195 Views
3 Replies

Anonymous
Not applicable
2011-11-30
09:50 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
195 Views

Anonymous
Not applicable
2011-12-01
11:08 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
<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>
195 Views

Anonymous
Not applicable
2011-12-01
08:10 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
195 Views
