请问,有二个Xml文件,需要用第二个文件的节点替代第一个文件的节点,如何编写?用ReplaceChild只能换同一个文件的节点
Dim doc As New System.XML.XmlDocument()
Doc.Load("D:\桌面\bb.xml")
Dim doc1 As New System.XML.XmlDocument()
doc1.Load("D:\桌面\aa.xml")
Dim root As System.XML.XmlNode = doc.DocumentElement
Dim ndlist As System.XML.XmlNodelist = Doc.GetElementsByTagName("title")
Dim ndlist1 As System.XML.XmlNodelist = Doc1.GetElementsByTagName("title")
'Replace the title element.
root.ReplaceChild(ndlist1(1), ndlist(1))
aa.xml
<book genre="novel" ISBN="1-861001-57-5">
<title>Pride And Prejudice</title>
<title>aaaa And aaaaaaaaaa</title>
</book>
bb.xml
<book genre="novel" ISBN="1-861001-57-5">
<title>Pride And Prejudice</title>
<title>The Handmaid's Tale</title>
<title>ccccc And ccccccccc</title>
</book>