Private void button3_Click(object sender, EventArgs e)
{
// the other documents will be merged into this one
// under the Container element
XmlDocument doc = new XmlDocument();
XmlNode cont = doc.CreateElement("Container") ;
doc.AppendChild(cont);
// first document to merge
XmlDocument stuff = new XmlDocument();
stuff.Load("C:\\Reports\\ ASvfvvDAE745131_scan_Report. xml");
XmlNode imported =
doc.ImportNode(stuff. DocumentElement, true);
doc.DocumentElement. AppendChild(imported);
// second document to merge
stuff.Load("C:\\Reports\\ WINXP-PC_scan_Report.xml");
imported = doc.ImportNode(stuff. DocumentElement, true);
doc.DocumentElement. AppendChild(imported);
// third document to merge
stuff.Load("C:\\Reports\\ WINXP-PC_scan_Report.xml");
imported = doc.ImportNode(stuff. DocumentElement, true);
doc.DocumentElement. AppendChild(imported);
// print merged documents
// MessageBox.Show(doc.InnerXml);
doc.Save("C:\\Reports\\ Masterreport.xml");
}
No comments:
Post a Comment