I'm confused
-
In the floowinf code I am expecting to append source node to end of destination node but????? //I get the node here based on a source and destination ID. XmlNode sxnode = dom.SelectSingleNode("//KeeperElement[ID = " + srcID + "]"); XmlNode dxnode = dom.SelectSingleNode("//KeeperElement[ID = " + destID + "]"); //This works fine proper nodes are obtained //This append doesn't seem to be working for some reason dxnode.AppendChild(sxnode.CloneNode(true)); //Also the remove not working dom.RemoveChild(sxnode); //When I reload file it shows no changes???? I have experience with ADO.Net do I need to do some sort of Update or AcceptChanges or something similar. Thanks Mike
Everybody gotta be somebody
-
In the floowinf code I am expecting to append source node to end of destination node but????? //I get the node here based on a source and destination ID. XmlNode sxnode = dom.SelectSingleNode("//KeeperElement[ID = " + srcID + "]"); XmlNode dxnode = dom.SelectSingleNode("//KeeperElement[ID = " + destID + "]"); //This works fine proper nodes are obtained //This append doesn't seem to be working for some reason dxnode.AppendChild(sxnode.CloneNode(true)); //Also the remove not working dom.RemoveChild(sxnode); //When I reload file it shows no changes???? I have experience with ADO.Net do I need to do some sort of Update or AcceptChanges or something similar. Thanks Mike
Everybody gotta be somebody
Where did you save the file ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Where did you save the file ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Sorry, I guess that would make a difference wouldn't it?? private void button2_Click(object sender, EventArgs e) { string str = Application.StartupPath + "\\KeeperOut.xml"; XmlTextWriter writer = new XmlTextWriter(str, Encoding.UTF8); dom.WriteContentTo(writer); writer.Flush(); writer.Close(); } Thanks Mike
You can do anything you want but you pay for everything you do!