I have two Xml:-
String xmlA="<user><name>Jai</name><age>31</age><dob>28March1990</dob></user>";
String xmlB="<user><name>Jai Singh</name><age>31</age><dob>28March1990</dob></user>";
Now After parsing and comparing, I want to show the results in following order:-
Name : Jai JaiSingh
Age: 31 31
dob: 28March1990 28March1990
My question: What is the easiest method to approach this?
Can I use xmlUnit for comparing in this scenario?
Using xmlunit
Create two xml documents and compare using
Diff
. TheDifferenceEngine
accepts aDifferenceListener
. You can add your logic there.