Pages

Tuesday, 23 April 2013

How to show value of attributes of child nodes of an element in C#?

How to show value of attributes of child nodes of an element in C#?

Lets say you have following XML and you have to fetch IDs of Element tags which are under Segments/Segment/Elements. In this case you have to use SelectNodes method to reach upto desired nodes and then take it to the XMLNodeList. Iterate the list check its child nodes and get the attributes of child nodes. I think below code can clear what I am trying to say.