Tool or library for comparing xml files [closed]

断了今生、忘了曾经 提交于 2019-11-28 04:06:48
John Virgolino

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!

Sylverdrag

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.

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

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

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.

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

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.

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

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.

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

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!

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

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).

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!