Все узлы сведений > свойств из файла Details.xml должны перейти во второй узел компании в файле Company.xml.
company.xml
Код: Выделить всё
1234
{{details go here }}
Код: Выделить всё
Acme Inc
100 Ocean Dr
LA
CA
90210
Engineering
2024-ABC123
Код: Выделить всё
1234
Acme Inc
100 Ocean Dr
LA
CA
90210
Engineering
2024-ABC123
Код: Выделить всё
public static void TestMerge()
{
string destinationXml = "C:\\temp\\company.xml";
string sourceXml = "C:\\temp\\details.xml";
XElement xFileRoot = XElement.Load(destinationXml);
XElement xFileChild = XElement.Load(sourceXml);
var querySource = xFileChild.Element("details");
var queryDestination = xFileRoot.Element("properties");
Console.WriteLine(queryDestination);
}
Есть предложения?
Подробнее здесь: https://stackoverflow.com/questions/790 ... nother-xml
Мобильная версия