XMLComparator homepage

What is it ?

This is a simple tool to compare 2 xml documents. The program can stop at the first difference detected or keep going till the end of the parsings and report all the differences in text files or GUI. It uses the SAX api to be fast and use as less as memory as possible.

How to use it ?

You need xerces 1.X in your classpath and the jar of the application "xmlcomparator.jar" in order to run the comparator.

The comparator has 2 modes :

- stop at the first difference detected

- detect all the differences between the docs

If you need to use the first mode ( in a test for example ), you can use the main class org.xmlcomparator.SaxComparator that needs two arguments, the two files you need to compare.

From the command line you can type :

java org.xmlcomparator.SaxComparator bobo.xml bobo2.xml

the output will be :

The two following sax events seems different:

1 differences were detected between bobo.xml and bobo2.xml

Now if you need to know all the differences between 2 xml documents, you can use from the command line the class org.xmlcomparator.gui.text.Runner

If you type :

java org.xmlcomparator.gui.text.Runner bobo.xml bobo2.xml

2 files bobo.xml.diffresult and bobo2.xml.diffresult will be created and the program should ens displaying in the console :

2 differences where detected between bobo.xml and bobo2.xml

A swing gui will be developped soon. The differences will be visible grafiquely, with colors and stuffs...

If you have any comments, suggestions (even insults), I would be glad to get any feedback :)