Here, I want to loop through the <detail>
elements. Although I can specify the <detail>
tag name in my code, I can't use the tag names of the children. I want to know the tag names of those elements and their values.
How can I loop through them and do this?
<?xml version="1.0" encoding="utf-8" ?>
<body>
<detail>
<FirstName>t1 </FirstName>
<LastName>t2</LastName>
<Company>t3</Company>
<Country>t4</Country>
<Proviance>MP</Proviance>
<city>indore</city>
</detail>
<detail>
<FirstName>t5 </FirstName>
<LastName>t6</LastName>
<Company>t7</Company>
<Country>t8</Country>
<Proviance>t9</Proviance>
</detail>
<detail>
<FirstName>t10 </FirstName>
<LastName>t11</LastName>
<Company>t12</Company>
<Country>t13</Country>
<Proviance>t14</Proviance>
</detail>
</body>