What program can be used to compare xml files? [closed]

Posted on

Problem :

I am desperately searching for a tool (windows or Linux) with which I can compare two xml files, without spending half a day of configuring the tool. There are a lot of answers already in SO, but those tools either just don’t work (e.g. xmldiff which always gets killed), does not work as expected (e.g. ExamDiff) or might work but require a lot of configuring (e.g. WinMerge).

I am looking for a damn simple tool to compare xml content, split into the different attributes etc., if the files does not have newlines. The last tools mentioned above compare the files, and found one difference: a line many kBytes long. This is not what I want.

When I have two filws starting with the following:

<rci_request version="1.1"><set_setting><boot><static>on</static>...
<rci_request version="1.1"><set_setting action="deferred">...

I want the single different elements pointed out, like

<static>on</static>

or

<set_setting action="deferred">

and now the whole line consisting of 42246 characters.

Again, a simple to use tool needed to do the above task.

Solution :

Notepad++ download here should do exactly as you ask.

Quick guide here on using the compare/difference tool.

edit: Apologies, as matan129 stated you need to go to Language -> XML.

One solution is to ‘split’ the file manually before doing a normal diff (diff, kdiff, whatever) by applying

sed -i 's/>/>n/g' file.xml

to manually insert newlines. Of course, the splitting can be improved to split at full tags, but this solution is a workaround as there seem to exist no standalone solutions.

Leave a Reply

Your email address will not be published.