42

I am looking for an XML comparing tool that understands xml. It cannot be a line by line comparision like WinMerge or Beyond Compare.

An ideal solution would be one that shows changes similar to the way Word 2007 shows track changes. DeltaXML does this, but does not come with a real GUI 'out of the box' and is $500 per user!:

ExamXml works out of the box but displays the differences in a confusing manner. It does not have a concept of before and after, it just shows the differences:

alt text
(source: a7soft.com)

The tool should have the concept of using attributes as a key, so that it does not think that a reordered list of elements has changed. DeltaXML does this but I failed to set it up correctly for the screen shot.


UPDATE:

So far ExamlXML is the best out of the box solution. But it lacks the change management concepts of DeltaXML. Resulting in some usability problems.

DeltaXML is pretty much the solution I need, but something with more functionality out of the box would be better. DeltaXML requires writing java code to call the api, along with writing XSL to transform the xml into the expected input.

7
  • Please clarify more - in your example what output should the putative diff tool produce?
    – anon
    Feb 13, 2009 at 20:20
  • 1
    Who is downvoting all the answers to this question? Pretty childish. Feb 13, 2009 at 20:58
  • I upvoted a number of them myself, as I feel that all the utilities mentioned are quality applications that nontechnical people could handle with some training. Feb 13, 2009 at 21:00
  • I have 1/2 of a solution to this implemented already in .NET (currently merges XML files, but part of that is diffing them to see what to merge). I could 1-off a copy that does what you want, if you want to better define the output: Graphical or text only? command line or win? *nix, win or mac? Feb 17, 2009 at 20:14
  • I appreciate the offer rally25rs, but I am looking for something more off the shelf.
    – joe
    Feb 19, 2009 at 19:32

13 Answers 13

19

I am very surprised nobody mentioned Microsoft's XML NotePad

It's free and it can create a pretty good comparison, telling which elements/attributes have changed, moved, been deleted, etc.:

(Sorry if the screenshots are a little wide).

You can also apply XLSes to the XML file and do various editing operations. Well worth a try.

5
  • 1
    Can you tell me how to get to the compare feature? Thanks.
    – joe
    Feb 23, 2009 at 13:50
  • 2
    Sure. You open a xml file, then you go to the "view" menu and click on "compare XML files"
    – Sylverdrag
    Feb 24, 2009 at 9:05
  • I just tried XMLNotepad and I found it very interesting. Thanks for suggesting that. Jan 31, 2011 at 16:01
  • Just tried XML Notepad, and it seemed to have some bugs. Line from the xml file (read using vi) was <COVARIANCE factor-ref="VALUE" value="0.000729"/> but the diff in XML Notepad showed it as <COVARIANCE COVARIANCE="VALUE" COVARIANCE="0.000729"/>. The number 0.000729 is unique in the file, so I am positive I am seeing the same element.
    – Somesh Rao
    Aug 19, 2013 at 19:45
  • I would agree, XML Notepad is no longer updated, and is riddled with bugs, particularly when expanding or closing the hierarchy. If I had to use it, I could, but there's more robust and better designed tools out there.
    – gravity
    Apr 21, 2016 at 20:12
14
+100

If I understand your problem, you likely have an application that uses XML files as the data storage and the GUI abstracts the "technical" tag names into "user friendly" labels - again, I am assuming. So it would be a natural extension to view differences in a similar way. I am also assuming your application doesn't have a diff facility that follows the "abstraction" concept.

I did some searching and found one app (ExamXML) that seems to come close with highlighting features. I downloaded the eval version and tested your files against it:

http://www.programmedintheusa.com/images/stack547399.png

It does a pretty good job of highlighting the differences. It seems pretty interactive and pops up with how many differences. It looks like you can change the colors it uses, so maybe you can use grays and whites to de-emphasize the tags. It also seems to have a lot of options that you can pre-set for your users as well.

I want to note that you will be hard pressed to find an XML comparison tool that will not show the tag names, as the tags are what give the content context. If you take away context, it becomes difficult to understand the data being displayed. Anyhow, maybe this tool might be helpful. Have you also tried to show your users some of these tools and see what they are willing to tolerate, sometimes they may surprise you. Hope this helps!

2
  • What was on the picture before it was removed? A screenshot? Sep 11, 2013 at 7:56
  • @JirkaHanika Yes. Not sure why it went away like that. Oct 7, 2013 at 16:19
5

SourceGear's DiffMerge is free for a single-user:

http://www.sourcegear.com/diffmerge/

1
  • Be sure to set the preferences to show differences only. Feb 17, 2009 at 20:15
3

I might try DeltaXML + an XSLT transform to get the specific result that you want. One problem with using plain-text compare tools with XML is that the physical form of an XML document (its indenting, etc.) can change even if the content itself doesn't, which could lead to a lot of false positives. DeltaXML is a very good tool for comparing document-based XML.

Also, depending on the editor your users use, it may have XML differencing built-in. For example, Arbortext Editor has a good tool that shows the text (not the tags) with changes highlighted / struck-through.

1
  • This looks like a good solution, although on the expensive end ($500 per user).
    – joe
    Feb 18, 2009 at 19:51
3

Altova diffDog XML Spy and diffDog are exceptional tools. Pry them from my cold dead hands, kinda stuff.

2

Beyond Compare is excellent as @BobbyShaftoe has already mentioned. For merging however, I like to use Araxis Merge. We use it for similar purposes quite often.

As far as your comment about the nontechnical ability of your users:

Thanks for the Responses... But these all seem too technical. My users normally do not see the xml tags because their XML authoring tool abstracts them away. Are there any tools that display differences in the text content, but do not show (or de-emphazise) the xml tags.

I'm going to throw this out there: your users should learn. If you have them merging and changing XML files - I'm assuming potentially for record keeping or application configuration - then they should have at least a rudimentary understanding of what they're doing. They don't have to be XML whizzes to use the tools listed and get the job done.

If, however, requiring your users to have a rudimentary knowledge of the job they are doing is impossible, then I would suggest writing a configuration utility yourself and delivering it for your end users, rather than relying on 3rd party software.

1

Try XML Notepad from Microsoft MSDN XML it has a compare XML files. No idea how good it is.

0

Have you tried examdiff? Of course it's still a tech tool, but it's easy to work with. It has a drag and drop interface to compare files.

0

I always use kdiff3. It's easy to use and can compare up to 3 files. http://kdiff3.sourceforge.net/

2
  • Is it XML sensitive? I do not think so, I believe it just treats them as plain text files and so spot diffs that do not exist in the XML infoset (such as a change of encoding).
    – bortzmeyer
    Feb 24, 2009 at 16:49
  • you are right - its only text comparison.
    – mspoerr
    Feb 25, 2009 at 15:00
0

You may find The XML Diff and Patch GUI Tool (sample code on MSDN) meets your needs a little better: it still shows tags, but emphasizes the difference in text. Since you get the code, for a little more effort you could tailor it more precisely to your requirements.

Although the sample is relatively elderly (July 2004, and has its roots in 2002) it upgrades to Visual Studio Express C# 2008 painlessly. Don't be put off when downloading the sample from the MSDN site if/when the installer MSI mentions "SQLXML Bulkload in .NET Code Sample" - it's not!

1
  • Thanks for the link. I ran the utility on some files that the user would of, and the compare output was a nice format. Unfortunately it inaccurately marked some of the xml as different when it was not.
    – joe
    Feb 16, 2009 at 19:59
0

Either programatically or UI, you can use XmlDiff, XmlPatch tools and library from MSDN For details how it work, check out the guide.

http://msdn.microsoft.com/en-us/library/aa302294.aspx

1
  • I have tested this and it simple outputs incorrect results.
    – joe
    Feb 18, 2009 at 20:47
0

Oxygen XML Editor has the best collection XML diff's tool I have found. There are several different Algorithms for comparison, so if the default doesn't work for you, try Syntax Aware or some of the other Algorithms (now, I am using version 8 and haven't upgraded to version 10 so ymmv, but I doubt that the XML diff has gotten worse).

0

I know this is an oldish thread, but Project: Merge is a new Windows application that can manage two-way and three-way merges and comparisons of XML files. (A three-way operation assumes there are two files that are both derived from a common base file.)

You might need to tell it how to identify individual elements to work perfectly on your files, but that's easy enough to do, and you'll only need to do it once.

Not the answer you're looking for? Browse other questions tagged or ask your own question.