i have a project with xml,i must open a xml file in tree view,i've done this,but now
i want to add node.i have a existing file witch i've open,and in this xml file i need to insert new node,can someone help me with this.
thank you very much
There are severals methods to add a node to your xml file including the use of the DOM(Document object models) methods so a propose this code I invite u to try it
suppose that we have an xml file
we want add
to the xml file
try to execute this method
public void Main()
XmlDocument doc = new XmlDocument();
XmlNode root = doc.DocumentElement;
//Create the E node.
XmlElement oNodeE = doc.CreateElement("E");
//Create the F node
XmlNode oNodeF = doc.CreateElement("F");
oNodeF.InnerText = "book4";
//Add the node to the document.
//Save the file contents
There is not only this method of corse u can use other alternatives using xmlwriter, text writer
and within the .Net framework 3.5 there is xLing
library witch simplify a lot the achivement of such task