免费的 C# XML Diff 库或类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/655141/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Free C# XML Diff library or class
提问by lak-b
I'm looking for XML Diff class or library. There are my requirements: - open source :) - object model for output (*) - rather fast (for 4mb XML)
我正在寻找 XML Diff 类或库。我的要求是: - 开源 :) - 输出对象模型 (*) - 相当快(对于 4mb XML)
I'm trying to use MS XML Diff and Patch Tools, but I wanna get a list of objects with differences of 2 XML files (instead HTML markup).
我正在尝试使用 MS XML Diff 和 Patch Tools,但我想获取具有 2 个 XML 文件(而不是 HTML 标记)差异的对象列表。
UPD: Thanks for all of your responses. I implemented my own solution; it's not too hard with Linq2Xml :) UPD2: Sorry guys, but i can't post my solution here now (i actually haven't got it because i have changed my work recently). Also my solution have some specific parts, so it can't suit common problems any way. The main advice is to use Linq2Xml, implement your logic and have fun :)
UPD:感谢您的所有回复。我实现了自己的解决方案;使用 Linq2Xml 并不太难 :) UPD2:抱歉各位,但我现在不能在这里发布我的解决方案(我实际上还没有得到它,因为我最近改变了我的工作)。我的解决方案也有一些特定的部分,所以它不能以任何方式解决常见问题。主要建议是使用 Linq2Xml,实现您的逻辑并玩得开心:)
采纳答案by joe
回答by TheAlbear
Not quite sure from you post if you are tring to do this in code or not.
不太确定您是否要在代码中执行此操作。
But if you are just after a nice programe to view the two documents side by side and see the difreances and make changes to them i would recomend Beyond Compare 3.
但是,如果您只是在一个不错的程序之后并排查看两个文档并查看差异并对其进行更改,我会推荐Beyond Compare 3。
回答by David
The Microsoft XML Diff and Patch tool does give you the list of differences between 2 XML document. The output is an XML document that tells you how to change document #1 into #2.
Microsoft XML Diff and Patch 工具确实为您提供了 2 个 XML 文档之间的差异列表。输出是一个 XML 文档,它告诉您如何将文档 #1 更改为 #2。