Reading multiple Child Nodes in XML stage
Posted: Thu Jan 19, 2012 9:06 am
One of our sources sends us XMLs.
I am facing an interesting issue how to parse multiple child nodes.
How do we deal with multiple child nodes in XML stage, where the nodes are repeating.
Since we don't know how many child nodes might appear, and all these nodes are identical , for e.g. if we consider multiple email addresses associated with a person. the XML will look like :
<Person>
<email>
XYZ@xyz.com
<email/>
<email>
abc@qwr.com
<email/>
<email>
pqr@qwr.com
<email/>
.
.
.
<Person/>
What i am currently doing is I am reading the individual xpaths in a transformer and then taking only 10 instances ahead.
Which is not a great way to do it.
But I really want to understand how such scenarios are handled.
Please let me know if anyone has a better way to do it.
I am facing an interesting issue how to parse multiple child nodes.
How do we deal with multiple child nodes in XML stage, where the nodes are repeating.
Since we don't know how many child nodes might appear, and all these nodes are identical , for e.g. if we consider multiple email addresses associated with a person. the XML will look like :
<Person>
<email>
XYZ@xyz.com
<email/>
<email>
abc@qwr.com
<email/>
<email>
pqr@qwr.com
<email/>
.
.
.
<Person/>
What i am currently doing is I am reading the individual xpaths in a transformer and then taking only 10 instances ahead.
Which is not a great way to do it.
But I really want to understand how such scenarios are handled.
Please let me know if anyone has a better way to do it.