Comparing these two snippets of XML:
testXml:
<ELEMENT1>
<CHILD1></CHILD1>
</ELEMENT1>
actualXml:
<ELEMENT1>
<CHILD1>notEmpty</CHILD1>
</ELEMENT1>
using:
Diff diff = new Diff(testXml, actualXml);
Detailed detailedDiff = new DetailedDiff(diff);
Now detailedDiff.getAllDifferences();
will return a DifferenceConstants.HAS_CHILD_NODES_ID
difference and if you print the difference to the console it looks like this:
Expected presence of child nodes to be 'false' but was 'true' - comparing <CHILD1...> at /ELEMENT1[1]/CHILD1[1] to <CHILD1...> at /ELEMENT1[1]/CHILD1[1]
My question is, why is the difference of type DifferenceConstants.HAS_CHILD_NODES_ID
and not DifferenceConstants.TEXT_VALUE_ID
? The structure of the two XML-snippets are the same, but the text value of the two differs.
So, why doesn't that trigger a difference?