1

I am comparing XML files with XMLUnit and was wondering and if an element does not exist in one of the files then all subsequent elements generate the alert of: [not identical] Expected sequence of child nodes 'X' but was 'Y'. I am wondering if there is an easy way to prevent these alerts from being generated in the output.

Thanks

1 Answers1

0

If you just don't want different tags to be compared, you can easily add this line

XMLUnit.setCompareUnmatched(Boolean.FALSE);

But if you want to ignore a tag you must override DifferenceListener, here a link that may help you.

Community
  • 1
  • 1
Mouna
  • 3,221
  • 3
  • 27
  • 38