Finding the difference between two XML files

I created two XML files that display the contents of this folder:

<root>
    <folder name="C:\a\b" permision="yes" folderCount="1">
        <folders>
            <folder name="C:\a\b\c" permision="yes" folderCount="1">
                <folders>
                    <folder name="C:\a\b\c\e" permision="yes" folderCount="0">
                <folders/>
                <files>
                    <file name="401-1.htm"/>
                    <file name="401-2.htm"/>
                    <file name="401-3.htm"/>                              
                </files>
            </folder>
            <folder name="C:\a\b\d" permision="yes" folderCount="0">
                <folders/>
                <files>
                    <file name="401-4.htm"/>
                    <file name="401-5.htm"/>
                    <file name="401-3.htm"/>                                
                </files>
            </folder>
        </folders>
        <files/>
    </folder>
</root>

I would like to know if there is a way to find the difference between the files.

(One file is the old state, the second is the new state, and you can only add files to it, and not delete them. It would be great to remove the same nodes from the new state, so that only new files remain).

+3
source share
2 answers

I would use LINQ for XML, as the project below:

Diff in XML files with LINQ:
http://www.codeproject.com/KB/linq/LinqDiff.aspx

+3
source

, Microsoft'ss XML Diff Patch GUI Tool, , , XML . , XML .

, .

+1

Source: https://habr.com/ru/post/1763321/


All Articles