Dim xmlDoc As New System.XML.XmlDocument xmlDoc.Load("d:\201510020.xml") Dim root As System.XML.XmlNode = xmldoc.SelectSingleNode("Document/Events/Event/DataField") msgbox(root Is Nothing) Dim xel As System.XML.xmlelement = xmldoc.CreateElement("Data") xel.SetAttribute("Code","889824100000") xel.SetAttribute("CorpOrderID","201510020 ") xel.SetAttribute("Actor","") xel.SetAttribute("ActDate","2015-10-22") xel.SetAttribute("CorpProductID","") xel.SetAttribute("CorpBatchNo","") xel.SetAttribute("ProduceDate","2015-08-28") xel.SetAttribute("ToCorpID","") root.appendchild(xel) xmldoc.save("d:\201510020.xml")
|