Loading tools/XmlDiff/src/org/etsi/mts/ttcn/part9/xmldiff/XmlDiff.java +14 −4 Original line number Diff line number Diff line Loading @@ -8,13 +8,13 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.List; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.Difference; import org.custommonkey.xmlunit.XMLUnit; import org.xml.sax.SAXException; /** This class implements an algorithm to compare two XML files. Loading Loading @@ -71,13 +71,23 @@ public class XmlDiff { } catch (IOException e) { throw new XmlDiffError("Failed to read XML", e); } boolean result = differ.identical(); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); boolean result = differ.identical() || differ.similar(); if (!result) { DetailedDiff details = new DetailedDiff(differ); @SuppressWarnings("unchecked") List<Difference> diffs = details.getAllDifferences(); if (diffs.isEmpty()) { result = true; } else { for (Difference diff : diffs) { diffDetails.append(diff.getDescription()); diffDetails.append(diff.toString()).append('\n'); } } } return result; Loading Loading
tools/XmlDiff/src/org/etsi/mts/ttcn/part9/xmldiff/XmlDiff.java +14 −4 Original line number Diff line number Diff line Loading @@ -8,13 +8,13 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.List; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.Difference; import org.custommonkey.xmlunit.XMLUnit; import org.xml.sax.SAXException; /** This class implements an algorithm to compare two XML files. Loading Loading @@ -71,13 +71,23 @@ public class XmlDiff { } catch (IOException e) { throw new XmlDiffError("Failed to read XML", e); } boolean result = differ.identical(); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); boolean result = differ.identical() || differ.similar(); if (!result) { DetailedDiff details = new DetailedDiff(differ); @SuppressWarnings("unchecked") List<Difference> diffs = details.getAllDifferences(); if (diffs.isEmpty()) { result = true; } else { for (Difference diff : diffs) { diffDetails.append(diff.getDescription()); diffDetails.append(diff.toString()).append('\n'); } } } return result; Loading