question

EdouardDurand-3527 avatar image
0 Votes"
EdouardDurand-3527 asked JackJJun-MSFT commented

Questions to develop an app to compare and merge XML files

Hello,

If I am developing a C# application that allows to compare two XML files and also to merge two XML files, how should I make it?

Which libraries to use?

Do you have examples on comparing 2 XML files and merging 2 XML files?

I would also like to output a report that lists the differences between the 2 XML files.

Thank you for your help.

dotnet-csharpwindows-forms
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

File comparison is a feature found in source control or editor plugins. It might be better to go with an existing application that has the features you need since your question is broad in scope.

However, if you want to build your own XML merge utility then take a look at the System.XML namespace. System.XML contains a lot of libraries for working with XML.


1 Vote 1 ·

I do not want to use an existing app. I want to develop in C# some features to compare 2 XML files and also merge 2 XML files so that I can add some specific things.
The issue is that I do not see how to compare two files because there is no order in XML files and a lot of nodes and sub nodes.

Do you have some good examples about it?

0 Votes 0 ·
JackJJun-MSFT avatar image JackJJun-MSFT EdouardDurand-3527 ·

@EdouardDurand-3527, Welcome to Microsoft Q&A, Could you explain how to compare and merge XML files in more detail? It will make your problem more clearer if you provide the xml example.
We are waiting for your update.

0 Votes 0 ·

1 Answer

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

doing diffs is a whole field of computer science.

here is a simple diff library to get you started:

https://github.com/BrutalSimplicity/XmlDiffLib



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.