Comparing two documents with the custom DifferenceListener That Ignores Attributes

    String expected = "<root>Hello</root>";
  String actual = "<root><![CDATA[Hello]]></root>";
  DifferenceListener listener = new CDATAEqualsText();
  Diff myDiff = new Diff(expected, actual);
  myDiff.overrideDifferenceListener(listener);
  assertTrue(myDiff.identical());

Previous | Next | Top | Cafe con Leche

Copyright 2005, 2006 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified August 19, 2005