Hi,
I am developing a tool. that want to find the elements of xml file's and replace the contents. first i want ot find that the xml file contain DOCTYPE or not. if yes i want to change the values of that.
i tried this code. but got error,
var files = Directory.GetFiles(txtpath.Text);
foreach (var f in files)
{
//doc = XDocument.Load(f);XmlDocument xmldoc = new XmlDocument();xmldoc.LoadXml(f.Substring(f.IndexOf(Environment.NewLine))); // Error In this line.var node = xmldoc.SelectSingleNode("//DOCTYPE");if (node != null){}
//ele = XElement.Load(f);
}
how to do this. Thanks In Advance.

Ashish VishwakarmaRank #575 · 4.2K reputationPosted Apr 25, 2017, 8:53 PM EDT
Karthi KeyanRank #1,926 · 762 reputationPosted Apr 25, 2017, 9:03 PM EDT