+ //Diff diff = new Diff(getCompareDoc(controlXml), getCompareDoc(testXml));
+ final org.xmlunit.diff.Diff documentDiff = DiffBuilder
+ .compare(controlXml)
+ .withTest(testXml)
+ .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byName))
+ .checkForSimilar()
+ .withDifferenceEvaluator((comparison, outcome) -> {
+ if (outcome != ComparisonResult.EQUAL && comparison.getType() == ComparisonType.ATTR_VALUE) {
+ Attr a = (Attr) comparison.getControlDetails().getTarget();
+ if ("commit-seconds".equals(Nodes.getQName(a).getLocalPart()) || "commit-localtime".equals(Nodes.getQName(a).getLocalPart())
+ && "configuration".equals(Nodes.getQName(a.getOwnerElement()).getLocalPart())) {
+ return ComparisonResult.EQUAL;
+ }
+ }
+ else
+ return ComparisonResult.SIMILAR;
+
+ return outcome;
+ })
+ .ignoreComments()
+ .ignoreWhitespace()
+ .build();
+ if(documentDiff.hasDifferences())