I've a XML file as shown below i want to update the path of the flv files which i've made bold below. Actually i've a playlist and my video player takes the properties from this XML file so i've to play the different different video which i click on.
-
Vimal KandasamyPosted Feb 16, 2009, 5:45 AM
you can update an xml file in the following way... i wrote this code in c#.
FileStream H = new FileStream(filepath, FileMode.Open);
XmlDocument xdoc=new XmlDocument();
xdoc.Load(H);
XmlNodeList list = xdoc.GetElementsByTagName("PLAYER_SETTINGS");
for (int i = 0; i < list.Count; i++)
{
XmlElement id = (XmlElement)xdoc.GetElementsByTagName("PLAYER_SETTINGS")[i];
if (id.GetAttribute("Name")=="SelectedLoader")
{
id.SetAttribute("Value")="your new file path";
}
}
H.Close();
xdoc.Save(filepath);
i think this will work for you...