I have a question regarding “Similar” and “Identical”. In the following example given on XMLUnit help page:

<author>Dan Brown</author>
<category></category>

And

<category></category>
<author>Dan Brown</author>

The output comes out to be:

Similar? true
Identical? false
***********************
Expected sequence of child nodes ’5′ but was ’7′ – comparing at /books[1]/book[1]/author[1] to at /books[1]/book[1]/author[1]
***********************
***********************
Expected sequence of child nodes ’7′ but was ’5′ – comparing at /books[1]/book[1]/category[1] to at /books[1]/book[1]/category[1]
***********************

My question how can we “NOT” include in the output such non-identical information? My problem is that I have a long xml documents to compare. There are cases, where the differences are related to orderring and in addition to others.

But when I get the total output, it gets kind of difficult to find the actual differences (non-orderring) related.

I have to manually skip the non-important information (orderring differences) from the actual differences for example if anything is missing in the reference documents or have different content etc.

Have said that, I read somewhere that such "orderring" problems can be solved with my own "custom DifferenceListener".

This element qualifier will consider a control element to be comparable with a test element if the element name matches, and if the attributes match (same amount of attributes, same attribute names, same values of attributes). It will find differences in the text node or child nodes of this element.