Read one xml to write it to another xml : Xml Write : XML C# Examples


C# Examples » XML » Xml Write »

 

Read one xml to write it to another xml









    
using  System;
using  System.Xml;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        XmlTextWriter  writer  =  new  XmlTextWriter("C:\\xmlWriterTest.xml",  null);

        writer.WriteStartDocument();

        writer.WriteEndElement();

        XmlTextReader  reader  =  new  XmlTextReader(@"C:\node.xml");
                
        while  (!reader.EOF)
        {
            writer.WriteNode(reader,  false);
        }


        //  Ends  the  document.
        writer.WriteEndDocument();

        writer.Close();

        return;
    }

}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo XML
» Xml Write