|
From: Sumit S. <su...@ho...> - 2002-05-21 00:36:51
|
XMLUnit.compare() or Diff() is returning only the
first difference. All the other differences are
ignored. How can I get all the differences
between control and test document?
Here is the sample code I am using:
=============================
import org.custommonkey.xmlunit.Diff;
import java.io.FileReader;
public class test_Diff {
public static String testFiles
(String controlFile, String testFile)
{
FileReader control = null;
FileReader test = null;
Diff diff = null;
try{
control = new FileReader(controlFile);
test = new FileReader(testFile);
} catch ( Exception ioe)
{
System.out.println("File read
problem");
};
try {
//diff = XMLUnit.compare(control, test);
diff = new Diff(control, test);
} catch (Exception e) {
System.out.println("Expection : "
+ e.toString());
};
return (diff.toString());
}
public static void main(String[] args) {
String controlFile = args[0];
String testFile = args[1];
System.out.println(testFiles(controlFile,
testFile));
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
|