all groups > dotnet xml > march 2007 >
You're in the

dotnet xml

group:

Compare two XML Files and save to One


Compare two XML Files and save to One lewis76 NO[at]SPAM gmail.com
3/20/2007 10:57:53 PM
dotnet xml:
Hi all,

I feel like this question has been asked before but I just cannot seem
to find a good answer.

Q: Is there a way to have two XML files and compare them and save them
to one.
Example:

XML-A:
<Season>
<Fruit>Orange</Fruit>
<Fruit>Strawberry</Fruit>
</Season>
XML-B:
<Season>
<Fruit>Orange</Fruit>
<Fruit>Banana</Fruit>
</Season>

Output to XML-C would be:
<Season>
<Fruit>Orange</Fruit>
<Fruit>Strawberry</Fruit>
<Fruit>Banana</Fruit>
</Season>


I downloaded and installed the "XML Diff and Patch" Tool

http://msdn.microsoft.com/xml/xmldownloads

However, I don't think that is what I am looking for. The
documentation seems to imply that I would be able to tell if their
Schemas are different but not actually save them to a different file.

Any help is appreciated.

Lewis
Re: Compare two XML Files and save to One Bjoern Hoehrmann
3/21/2007 12:00:00 AM
* lewis76@gmail.com wrote in microsoft.public.dotnet.xml:
[quoted text, click to view]

Could you explain what you mean by "compare" here? You example is
basically a merge of two documents; you could use XSLT to merge
them, other than that you'd have to write the code for it yourself
or pick a solution that does not ship with .NET. Then the most
obvious solution is probably XQuery.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
AddThis Social Bookmark Button