Xml Node List : Xml Node : XML C# Examples


C# Examples » XML » Xml Node »

 

Xml Node List









    
using  System;
using  System.Collections.Generic;
using  System.Data;
using  System.Text;
using  System.Xml;
using  System.Net;

public  class  MainClass
{
        public  static  void  Main(){
                
                string  xml  =  new  WebClient().DownloadString("http://blogs.apress.com/wp-rss2.php");

                XmlDocument  doc  =  new  XmlDocument();
                doc.LoadXml(xml);

                ProcessNodes(doc.ChildNodes);
        }

        private  static  void  ProcessNodes(XmlNodeList  nodes)
        {
                foreach  (XmlNode  node  in  nodes)
                {
                        Console.WriteLine(string.Format("{0}  -  {1}  -  {2}",node.GetType().Name,  node.Name,node.Value));

                        if  (node.HasChildNodes)
                                ProcessNodes(node.ChildNodes);
                }
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo XML
» Xml Node