I have this code:
private void btnConvert_Click(object sender, EventArgs e)
{
// Get a directory
string path = @"c:\WAMP\";
foreach (string fileName in Directory.GetFiles(path,
"*.xml"))
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(fileName);
((XmlAttribute)xdoc.SelectSingleNode("/XMD-entity/Meta/
@NAME")).Value = "new value";
((XmlAttribute)xdoc.SelectSingleNode("/XMD-entity/
Application_Data/Application_Info[@AI_TYPE='ETS_ADVERTISER']/Ai_Item/
@NAME")).Value = "new value";
xdoc.Save(fileName);
}
}
and I am working with the .xml files in this directory:
http://www.keepitsimplekid.com/xml
I want the text Untitled Ad in these xml docs to be replaced with the
Name of the ETS Advertiserr, in these examples LEAF GUARD OF LAKE ERIE
and REGIONAL CANCER CENTER
Now this code takes new value and inserts that text in the ETS
Advertiser name and also replaces Untitled Ad with new value.
How can I modify this code to read whatever is in ETS ADVERTISER and
then replace Untitled Ad with the text it gets from there.?