How can I get all the nodes of a xml file?

thitiessitema

New Member
Let's say I have this XML file:\[code\]<Names> <Name> <FirstName>John</FirstName> <LastName>Smith</LastName> </Name> <Name> <FirstName>James</FirstName> <LastName>White</LastName> </Name></Names>\[/code\]And now I want to print all the names of the node:\[code\]NamesNameFirstNameLastName\[/code\]I managed to get the all in a XmlNodeList, but I dont know how SelectNodes works.\[code\]XmlNodeList xnList = xml.SelectNodes(/*What goes here*/);\[/code\]I want to select all nodes, and then do a foreach of xnList (Using the .Value property I assume).Is this the correct approach? How can I use the selectNodes to select all the nodes?
 
Back
Top