Tool or library for comparing xml files [closed]
Asked Answered
O

13

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.

Outlive answered 13/2, 2009 at 19:47 Comment(7)
Please clarify more - in your example what output should the putative diff tool produce?Outofdoors
Who is downvoting all the answers to this question? Pretty childish.Dominations
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.Scholz
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?Cestus
I appreciate the offer rally25rs, but I am looking for something more off the shelf.Outlive
Joe, "It cannot be a line by line comparision" -- why not? I've used traditional line compare tools on XML many times. Can you please elaborate? This seems like a very odd question to me.Affluent
First off Jeff, you are the man! Anyway, its a little late but I will elaborate. My client has users that author content (write books) in a GUI app that looks like Word, but saves content in XML format. But the app does not have a diff or track change tool. So they went with ExamXML for this. :)Outlive
A
14

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!

Alicealicea answered 18/2, 2009 at 5:44 Comment(2)
What was on the picture before it was removed? A screenshot?Buttercup
@JirkaHanika Yes. Not sure why it went away like that.Alicealicea
G
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.

Gobi answered 22/2, 2009 at 17:21 Comment(5)
Can you tell me how to get to the compare feature? Thanks.Outlive
Sure. You open a xml file, then you go to the "view" menu and click on "compare XML files"Gobi
I just tried XMLNotepad and I found it very interesting. Thanks for suggesting that.Gan
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.Cesaria
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.Lynwoodlynx
A
14

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!

Alicealicea answered 18/2, 2009 at 5:44 Comment(2)
What was on the picture before it was removed? A screenshot?Buttercup
@JirkaHanika Yes. Not sure why it went away like that.Alicealicea
M
5

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

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

Marcelenemarcelia answered 13/2, 2009 at 19:58 Comment(1)
Be sure to set the preferences to show differences only.Answerable
P
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.

Pronator answered 17/2, 2009 at 23:12 Comment(1)
This looks like a good solution, although on the expensive end ($500 per user).Outlive
S
3

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

Stratigraphy answered 20/2, 2009 at 1:16 Comment(0)
S
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.

Scholz answered 13/2, 2009 at 20:55 Comment(0)
P
1

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

Primogenial answered 13/2, 2009 at 19:54 Comment(0)
S
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.

Sefton answered 13/2, 2009 at 19:49 Comment(0)
L
0

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

Laise answered 13/2, 2009 at 19:53 Comment(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).Gabriel
you are right - its only text comparison.Laise
E
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!

Exudate answered 13/2, 2009 at 22:23 Comment(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.Outlive
W
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

Wernsman answered 18/2, 2009 at 17:44 Comment(1)
I have tested this and it simple outputs incorrect results.Outlive
P
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).

Pet answered 21/2, 2009 at 19:47 Comment(0)
K
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.

Koren answered 28/8, 2010 at 12:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.