Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

How to get the index of a node in XML

Avatar

Level 9

Hello All,

I want to loop through all the xml nodes that I embed in my form. I want to get the index of the node.For Ex : My xml looks like this

<CustomerInformation>
<CustomerID></CustomerID>
<CustomerName></CustomerName>
<CustomerType>PFRR</CustomerType>
<ContactName></ContactName>
<AddressLine3></AddressLine3>
<TelephoneNo></TelephoneNo>
<ShipToCode></ShipToCode>
</CustomerInformation>

There are approx 150 <customerinformation> node present in the xml. I want to delete those nodes excluding the nonly node that's used to fill the data in the form. Lets say I have used node 20 to fill the form. I would loop through all the nodes and simly delete those exclusing the node 20. So that while submitting only the node goes as xml.

Thanks.

0 Replies