XPath Select Nodes : XPath : XML C# Examples


C# Examples » XML » XPath »

 

XPath Select Nodes









    
using  System;
using  System.Xml;

public  class  MainClass
{
    [STAThread]
    private  static  void  Main()
    {
        XmlDocument  doc  =  new  XmlDocument();
        doc.Load("Sample.xml");

        XmlNodeList  nodes  =  doc.SelectNodes("/Order/Items/Item/Name");
                
        foreach  (XmlNode  node  in  nodes)
        {
            Console.WriteLine(node.InnerText);
        }
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo XML
» XPath