MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
' Query both documents and Join on the SN node in each Dim results = From n1 In f1.Descendants("Table1") _ Where n1.Element("SN") IsNot Nothing _ From n2 In f2.Descendants("Table") _ Where n2.Element("SN") IsNot Nothing AndAlso n1.Element("SN").Value = n2.Element("SN").Value _ Select n1, n2 ' Copy the elements from File2 to File1 For Each pair In results Dim removeSN = pair.n2.Element("SN") removeSN.Remove() For Each element As XElement In pair.n2.Descendants() pair.n1.Add(element) Next Next ' Save file1.xml as file3.xml f1.Save("C:\Working Directory\file3.xml")
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.