XML File opening using DOM Object


XML File opening using DOM Object

Below example illustrate a code for opening XML file using DOM Object.


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

namespace XMLOpener
{
class CustomXML
{
static int Main(string[] args)
{
XmlDocument xmlDoc = new XmlDocument();
string strXMLFile = "XMLdata.xml";

if (File.Exists(strXMLFile ))
xmlDoc.Load(strXMLFile );
else
Console.WriteLine("The file"+strXMLFile +" not found.");

return 0;
}
}
}


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: