3向XML合并算法 [英] 3-way XML merge algorithm
问题描述
我希望能够对XHTML文档进行三向合并:
I want to be able to do a 3-way merge of XHTML documents:
- 从文档的某些原始副本开始
- 一个用户编辑原始文档的副本
- 另一个用户编辑原始文档的单独副本
- 需要一个工具来(自动和/或可视地)合并两个用户所做的更改.
注意:
- 我想将此功能包含在商业软件中:所以我更喜欢啤酒免费和/或开源的东西,而不是商业工具.
- 我怀疑如果该工具支持XML,比尝试使用
diff3
这样的实现纯文本3向合并的软件更好. - 鉴于所有三个输入文档都是有效的XHTML文档,因此生成的输出文档也应进行验证
- I want to include this functionality in commercial software: so I prefer something that's free-as-in-beer and/or open source, instead of a commercial tool.
- I suspect it's better if the tool is XML-aware, than to try to use software like
diff3
which implements 3-way merge of flat text - Given that all three input documents are valid XHTML documents, the resulting output document should validate too
我找到的工具包括:
- "3DM" XML 3向合并和区分工具
- Fuego Core XML差异和补丁工具
- XmlDiff(最近来自已关闭的GotDotNet站点,但也许作为 XML记事本)
- The "3DM" XML 3-way Merging and Differencing Tool
- Fuego Core XML Diff and Patch Tool
- XmlDiff (lately from the GotDotNet site which has been shut down, but maybe it's living on as a component of XML Notepad)
上面的第一个(即"3DM")明确表示它实现了三路合并.
The first of the above (i.e. "3DM") says explicitly that it implements 3-way merges.
我不了解其他两个:"diff"后跟"patch"是否等效于三向合并,或者"patch"是否只能将diff重新应用于原始文件(而不是文件的第三个副本)
I don't know about the other two: whether "diff" followed by "patch" is equivalent to a 3-way merge, or instead whether "patch" can only reapply the diff to the original file (and not to a third, altered copy of the file)
您是否可以为此目的推荐一些软件(从上面的列表或其他列表中)和/或对合并算法的描述?
Can you recommend some software (from the list above, or elsewhere) for this purpose, and/or a description of a merge algorithm?
匹配,区分和合并XML 是2008年的另一篇文章,其中包括对各种算法的简要概述以及对各种实现的引用.
Matching, diffing and merging XML is another article from 2008, which includes a brief survey of various algorithms and references to various implementations.
作者确认,Fuego Core XML Diff and Patch Tool只能修补原始文件,不能实现三路合并.
Edit #2: The author confirmed that the Fuego Core XML Diff and Patch Tool can only patche the original file, and doesn't implement 3-way merging.
推荐答案
I don't have a free solution, I'm afraid, but Project: Merge is a cheap XML comparison and merge tool which can be controlled through the command line. It could probably plug straight in to your application.
这篇关于3向XML合并算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!