I have the following method:
public static void assertXMLEquals(String expectedXML, String actualXML) throws Exception {
XMLUnit.setIgnoreWhitespace(true);
XMLUnit.setIgnoreAttributeOrder(true);
DetailedDiff diff = new DetailedDiff(XMLUnit.compareXML(expectedXML, actualXML));
List<Difference> allDifferences = diff.getAllDifferences();
Assert.assertEquals("Differences found: " + diff.toString(), 0, allDifferences.size());
}
It is from the class: http://www.xmlunit.org/api/java/2.4.0/org/custommonkey/xmlunit/Diff.html
If there are differences it prints out e.g :
[different] Expected attribute value 'false' but was 'true' - comparing <attribute name="false"...> at //journey[1]/attribute[1]/@name to <attribute name="true"...> at /journeyDetails[1]/journey[1]/attribute[1]/@name
Is there a way I can override this to print the line number?