| Iterating through all nodes in XML file in C#
Below is the code to print all the XML node in c# with below while loop
System.XML.XmlReader rdrstr = System.XML.XmlReader.Create(new System.IO.StringReader(xml));
while (rdrstr.Read())
{
if (rdrstr.NodeType == XmlNodeType.Element)
{
Console.WriteLine(rdrstr.LocalName);
}
}
| | |