Merging XmlDocumentFragment into XmlDocument

Hi, how can I insert XmlDocumentFragment into XmlDocument without creating duplicate nodes?

For example, if I have

<root>
<onmytable>
<book></book>
<cup></cup>
</onmytable>
</root>

and want to insert this:

<root>
<onmytable>
<book></book>
<pen></pen>
</onmytable>
</root>

as you guess to result in:

<root>
<onmytable>
<book></book>
<cup></cup>
<pen></pen>
</onmytable>
</root>

[652 byte] By [miloush] at [2007-12-23]
# 1

You have to implement a recursive algorithm for that, and it shouldn't be difficult. Also you might want to search for ready-to-use code samples in Internet. For example: Merging two XML Documents.

Best regards,
Anton

-AntonLapounov at 2007-8-30 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified