A.3. Changes from XMLUnit 1.2 to 1.3

A.3.1. Breaking Changes

A.3.2. New Features

  • If XMLUnit doesn't find a matching Element for a control Element, it will match it against the first unmatched test Element (if there is one) instead of creating a CHILD_NODE_NOT_FOUND Difference. There now is a new configuration option compareUnmatched in the XMLUnit class that can be used to turn off this behavior - as a result two CHILD_NODE_NOT_FOUND Differences (one for the unmatched control Element and one for an unmatched test Element) will be created instead of a single Difference comparing the two likely unrelated nodes. See Section 3.8.6, “Comparison of Unmatched Elements”. Issue 2758280.

A.3.3. Important Bug Fixes

  • If XMLUnit couldn't match attributes (i.e. it encountered a ATTR_NAME_NOT_FOUND_ID kind of difference), the XPath expressions of the node details have been random. Issue 2386807.
  • In some cases XMLUnit matched test nodes to multiple control nodes and then created a "missing child" difference for remaining test nodes even though they would have been valid targets for control node matches as well. Issue 2807167.