有没有免费的 Xml Diff/Merge 工具?

我有几个配置文件在我的.net 应用程序,我想合并应用程序设置元素等。

我正准备像往常一样手动完成这项工作,但是我认为在某个地方一定有一个 XML diff GUI 工具可用。

该工具将能够进入元素级别来比较和显示差异等。

然而,谷歌没有提供任何实质性的免费工具结果,也没有提示任何有价值的东西。

这样的工具可用吗? 这很有用吗? 免费吗?

提前谢谢:)

编辑:

下面是一些功能的说明,这些功能可以将我的容易出错、乏味的手工作业变成一个1分钟的简单任务(并且可能自动化) :

在 KDiff3中,您可以对整个目录执行 diff/merge 操作。这里有一个非常精确、用户友好和清晰的等级差异。我感兴趣的是找到一个类似的解决方案,但不是目录层次结构,而是 XML 元素层次结构。

如果没有这样的开源软件,我正在考虑在 CodePlex 上创建一个来提供这个功能。

136200 次浏览

KDiff3 is not XML specific, but it is free. It does a nice job of comparing and merging text files.

There are a few Java-based XML diff and merge tools listed here:

Open Source XML Diff written in Java

Added links:

I use TortoiseMerge, which is included in TortoiseSVN program

And we have talked about File Diff tools in this thread, not dedicated to XML though

https://stackoverflow.com/questions/1830962/file-differencing-software-on-windows

While this is not a GUI tool, my quick tests indicated that diffxml has some promise. The author appears to have thought about the complexities of representing diffs for nested elements in a standardized way (his DUL - Delta Update Language specification).

Installing and running his tools, I can say that the raw text output is quite clear and concise. It doesn't offer the same degree of immediate apprehension as a GUI tool, but given that the output is standardized as DUL, perhaps you would be able to take that and build a tool to generate a visual representation. I'd certainly love to see one.

The author's "links" section does reference a few other XML differencing tools, but as you mentioned in your post, they're all proprietary.

Altova's DiffDog has free 30-day trial and should do what you're looking for:

http://www.altova.com/diffdog/diff-merge-tool.html

This is a diff engine for java developers, but it comes with a demo interface - you might be able to use it: https://community.emc.com/docs/DOC-5042

I recommend you to use CodeCompare tool. It supports native highlighting of XML-data and it can be a good solution for your task.

I wrote and released a Windows application that specifically solves the problem of comparing and merging XML files.

Project: Merge can perform two and three way comparisons and merges of any XML file (where two of the files are considered to be independent revisions of a common base file). You can instruct it to identify elements within the input files by attribute values, or the content of child elements, among other things.

It is fully controllable via the command line and can also generate text reports containing the differences between the files.

Project: Merge merging three XML files

Pretty Diff tool was created with XML in mind. Just ensure you click the option for "markup".

http://prettydiff.com/

Have a look at File comparison tools, from which I am using WinMerge. It has an ability to compare XML documents (you may wish to enable DisplayXMLFiles prefilter for v2.14.0 or PrettifyXML for v2.16.x).

DisplayXMLFiles.dll - This plugin pretty-prints XML files nicely by inserting tabs and line breaks. This is useful for XML files that do not have line returns in convenient locations.

Note for v2.16.x

The plugin PrettifyXML is supplied with the software package. It can be activated as following:

  • Make sure that Plugins → Plugin Settings → Enable plugins is enabled.
  • Then use either File → Recompare As → Prettify XML or Plugins → Scripts → Prettify XML

For those who wish to play with deprecated DisplayXMLFiles, he needs to download e.g. winmerge-2.16.14-full-src.7z and copy Plugins\dlls\X64\DisplayXMLFiles.dll to WinMerge\MergePlugins\.

WinMerge in action

See also my feature comparison table.

A7Soft provide XML comparison tools freeware and shareware:

http://www.a7soft.com