Output XmlDocument to Console : Xml Display : XML C# Examples


C# Examples » XML » Xml Display »

 

Output XmlDocument to Console









    
using  System;
using  System.IO;
using  System.Xml;

public  class  MainClass
{
    public  static  void  Main()
    {
        XmlDocument  xmlDoc  =  new  XmlDocument();
        xmlDoc.LoadXml("<book  genre='programming'>  <title>ADO.NET  Programming</title>  </book>");

        XmlNode  root  =  xmlDoc.DocumentElement;
        Console.WriteLine("XML  Document  Fragment");

        xmlDoc.Save(Console.Out);
        Console.WriteLine();


        Console.WriteLine("XML  Document  Fragment  After  RemoveAll");
        root.RemoveAll();

        xmlDoc.Save(Console.Out);
    }
}
    
   
  
   



Output

XML Document Fragment
ADO.NET Programming
XML Document Fragment After RemoveAll



HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo XML
» Xml Display