XML Input to capture repetition elements
Posted: Thu Mar 27, 2008 2:28 pm
Hi,
I am trying to capture all the information including repetition elements from XML. I can only capture different values for the key element specified and for all the other elements i get repeated information same as the first record.
Example: Let us say this is my XML.
<customers>
<customer id="55000">
<name>Charter Group</name>
<address>
<street>100 Main</street>
<city>Framingham</city>
<state>MA</state>
<zip>01701</zip>
</address>
<address>
<street>720 Prospect</street>
<city>Boston</city>
<state>MA</state>
<zip>01210</zip>
</address>
<address>
<street>120 Ridge</street>
<city>waltham</city>
<state>MA</state>
<zip>01760</zip>
</address>
</customer>
</customers>
when i designate "/customers/customer/address/city/text()" as my repetition element i get the result as follows
55000,"Charter Group","100 Main","Framingham","MA","01701"
55000,"Charter Group","100 Main","Boston","MA","01701"
55000,"Charter Group","100 Main",Waltham,"MA","01701".
I am looking for a result like as follows
55000,"Charter Group","100 Main","Framingham","MA","01701"
55000,"Charter Group","720 Prospect","Boston","MA","01210"
55000,"Charter Group","120 Ridge",Waltham,"MA","01760"
Can anyone please help. Thanks in advance.
reddy
I am trying to capture all the information including repetition elements from XML. I can only capture different values for the key element specified and for all the other elements i get repeated information same as the first record.
Example: Let us say this is my XML.
<customers>
<customer id="55000">
<name>Charter Group</name>
<address>
<street>100 Main</street>
<city>Framingham</city>
<state>MA</state>
<zip>01701</zip>
</address>
<address>
<street>720 Prospect</street>
<city>Boston</city>
<state>MA</state>
<zip>01210</zip>
</address>
<address>
<street>120 Ridge</street>
<city>waltham</city>
<state>MA</state>
<zip>01760</zip>
</address>
</customer>
</customers>
when i designate "/customers/customer/address/city/text()" as my repetition element i get the result as follows
55000,"Charter Group","100 Main","Framingham","MA","01701"
55000,"Charter Group","100 Main","Boston","MA","01701"
55000,"Charter Group","100 Main",Waltham,"MA","01701".
I am looking for a result like as follows
55000,"Charter Group","100 Main","Framingham","MA","01701"
55000,"Charter Group","720 Prospect","Boston","MA","01210"
55000,"Charter Group","120 Ridge",Waltham,"MA","01760"
Can anyone please help. Thanks in advance.
reddy