| Write XML Code to print all Node Name through Loop in c#
Below is the code to print all the XML node in c# with below while loop
System.XML.XmlReader rdr = System.XML.XmlReader.Create(new System.IO.StringReader(xml));
while (rdr.Read())
{
if (rdr.NodeType == XmlNodeType.Element)
{
Console.WriteLine(rdr.LocalName);
}
} | | |