I am trying to see if I could use XMLUnit to compare the following two different XML. I used the Diff class to compare the following two XML and checking for similar returns false.
XML One
<Required>
<Question desc="Are you single?">
<Answers>
<Answer value="Yes"/>
<Answer value="No"/>
</Answers>
</Question>
</Required>
XML Two
<Required>
<Question desc="Are you single?">
<Answers>
<Answer value="No"/> ''Order is reversed in XML two
<Answer value="Yes"/>
</Answers>
</Question>
</Required>
Here is my JAVA code:
Diff xmlDiff;
try {
xmlDiff = new Diff(xmlOne, xmlTwo);
xmlDiff.overrideElementQualifier(new RecursiveElementNameAndTextQualifier());
} catch (Exception e) { }
boolean isEqual = xmlDiff.similar()