Save XML document to console and through XmlTextWriter : Xml Display : XML C# Examples


C# Examples » XML » Xml Display »

 

Save XML document to console and through XmlTextWriter









    
using  System;
using  System.Xml;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        XmlDocument  xmlDoc  =  new  XmlDocument();
        xmlDoc.Load(@"C:\xmlWriterTest.xml");

        XmlTextWriter  writer  =  new  XmlTextWriter("C:\\domtest.xml",  null);
        writer.Formatting  =  Formatting.Indented;
        xmlDoc.Save(writer);

        xmlDoc.Save(Console.Out);
    }              
      
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo XML
» Xml Display