First of all thanks for this great utility "XMLUnit".
I have a requirement where I want to compare 2 XML's and find the differences. Once the differences are found, I need to generate an excel report which will display the whole XML data (similar data as well as different data). The data similarities and differences will be highlighted in this excel using some color.
Example-
First XML-
<Project>
<Policy>
<Amount>20</Amount>
<Balance>10</Balance>
<PolicyDetails>
<Amount>30</Amount>
<SendDate>2017-04-03</SendDate>
</PolicyDetails>
<PolicyDetails>
<Amount>100</Amount>
<SendDate>2017-04-02</SendDate>
</PolicyDetails>
<PolicyDetails>
<Amount>50</Amount>
<SendDate>2016-04-02</SendDate>
</PolicyDetails>
</Policy>
</Project>
Second XML -
<Project>
<Policy>
<Amount>10</Amount>
<Balance>10</Balance>
<PolicyDetails>
<Amount>50</Amount>
<SendDate>2017-04-03</SendDate>
</PolicyDetails>
<PolicyDetails>
<Amount>100</Amount>
<SendDate>2017-05-05</SendDate>
</PolicyDetails>
</Policy>
</Project>
Now I need to find the similarities and differences of these XML's and generate an excel which will display data as-
I know I can read the XML's using JAVA one by one and do this but the actual XML's will have different combinations of data where ordering can be different, etc.
What I have done so far- I have used XMLUnit 2 "DiffBuilder" and found all the differences in these XML's. I have even used my custom DifferenceEvaluator for some custom logic.
I want to figure out how do I write the differences and similarities in the desired format in excel. Can anyone please help me here?
I also thought of implementing ComparisonListener and catch hold of every similarity and difference and start writing data from here in excel.