XmlUnit empty Elements -
I try to compare two XML with xmlUnit I have the following problem. When I have two empty elements such as xmlUnit the examples given below identify the elements as a difference. and
and & lt; Name & gt; & Lt; / Name & gt;
> I am only interesting in the difference, like the next two examples.
& lt; Name & gt; Test1 & lt; / Name & gt;
and & lt; Name & gt; Test2 & lt; / Name & gt;
difference: test1 and test2
or
& lt; Name & gt; Test 1 & lt; / Name & gt;
and & lt; Name & gt; & Lt; / Name & gt;
difference test1 and ...
My code:
`diff diff = new def (fr1, fr2); Detailed deaf detailed def = new wide df (difference); List gap list = detailed def.get all datafins (); The differences in the list = detailed def.get all dataference (); For (commodity object: difference) {difference difference = (difference) object; String node 1; String node 2; Node1 = difference.getControlNodeDetail (). GetNode () GetNodeName () + "" + Distance GetControlNodeDetail (). GetNode () GetNodeValue (); Node2 = difference.getTestNodeDetail (). GetNode () GetNodeName () + "" + difference .getTestNodeDetail (). GetNode () GetNodeValue (); }
`
your & lt; / Name & gt;
is a typo and according to the comment, & lt; Name / & gt;
,
Then you can try the following.
XMLUnit.setIgnoreWhitespace (true);
seems to work for me.
Meaning When I & lt; Carp 1 & gt; & Lt; / Carp1 & gt;
. with
& lt; Carp1 / & gt;
Try to compare,
expected text value '' but '' - comparison & lt; CfgDN ... & gt; & Lt; / CfgDN & gt; From / CFGDN [1] / Text () [19] to & lt; Cfgdn ... & gt; & Lt; / CfgDN & gt; On / CFGDN [1] / text () [19]
With the above settings, all are equal and equal.
Comments
Post a Comment