XmlTextReader : XmlTextReader : XML C# Examples


C# Examples » XML » XmlTextReader »

 

XmlTextReader









    
using  System;
using  System.Drawing;
using  System.Collections;
using  System.ComponentModel;
using  System.Windows.Forms;
using  System.Data;
using  System.Data.OleDb;
using  System.Xml;

public  class  MainClass{

      public  static  void  Main(){
        XmlTextReader  reader  =  new  XmlTextReader(@"C:\books.xml");

        while  (reader.Read())
                {
                        if  (reader.Name  !=  "bookstore")
                                reader.Skip();
                        else
                        {        
                                Console.WriteLine("Name:  "+reader.Name);
                                Console.WriteLine("Level  of  the  node:  "  +reader.Depth.ToString());
                                Console.WriteLine("Value:  "+reader.Value);
                        }      
                }
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo XML
» XmlTextReader