We have a serious problem on comparing two xml files.We need to find the difference between two xml files based on a key value.We need the difference in terms of xml tags and also values of the xml tags.The key values may be present in different positions in files.For example below are the two xml files example where id is the key for the students.In StudentDetails_one.xml file id 111 is present first, but in StudentDetails_two.xml id 222 is present first.
StudentDetails_one.xml
<Student>
<Id>111</Id>
<Name>AAA</Name>
<City>ABCD</City>
<Dept>CS</Dept>
<Mobile Number>11111</Mobile Number>
</Student>
<Student>
<Id>222</Id>
<Name>BBB</Name>
<City>ABCD</City>
<Dept>IT</Dept>
<Mobile Number>22222</Mobile Number>
</Student>
StudentDetails_two.xml
<Student>
<Id>222</Id>
<Name>CCC</Name>
<City>ABCD</City>
<DEPT>IT</DEPT>
<Mobile Number>22222</Mobile Number>
</Student>
<Student>
<Id>111</Id>
<Name>AAA</Name>
<City>ABCD</City>
<Dept>CS</Dept>
<Mobile Number>11111</Mobile Number>
</Student>
The below two differences can be noticed in the above 2 files.
- Student id 222 is having different Name value in both these 2 xml files.In first file its BBB and in second file its CCC.
- Student id 222 is having xml tag control difference as Dept in first file and DEPT in second file.
Is there any tool or technique to find out the above two differences ?
Note: The above one is just an example.We have the xml files with hundreds of tags.So its really difficult to find out the difference as The student id position is different in both the files