Groups | Blog | Home
all groups > dotnet xml > january 2006 >

dotnet xml : how to Merge to xml document ?


# Cyrille37 #
1/31/2006 9:47:22 PM
Hello,

I've to merge a peace of xml in another xml document.
Here is an example:

The doc:
<layout>
<win x="0">
<visible>false</visible>
<text>coucou</text>
</win>
</layout>

The other xml peace :
<layout>
<win x="10">
<visible>true</visible>
<backcolor rgb="25,25,25">
</win>
</layout>

The merge result should be:
<layout>
<win x="10">
<visible>truevisible>
<text>coucou</text>
<backcolor rgb="25,25,25">
</win>
</layout>

I can do that with some recursives loops but I come in that newsgroup
to ask if there are some tools in .Net API which manage such operation ??
Or if .Net does not have such operator, is there a external library that can do that ??

Thank you for your lights ;o)
Francois Beaussier
2/1/2006 12:00:00 AM
Hello

I would use the XmlDocument object. You can load both file in 1 line of code
and change the XmlNodes arround. Give it a try ^^

--
Francois Beaussier

"# Cyrille37 #" <cyrille37@free.fr> a écrit dans le message de news:
%23cDWHeqJGHA.1312@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

# Cyrille37 #
2/1/2006 9:14:59 PM
[quoted text, click to view]

The XML Diff and Patch GUI Tool

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/xmldiffgui.asp

Contents

Introduction
An Overview of the XML Diff and Patch API
XML Diff and Patch Meets Winforms
Working with XML DiffGrams
Other Features of the XML Diff and Patch Tool
AddThis Social Bookmark Button