红宝石的XML差异? [英] xml diff in ruby?
问题描述
用ruby合并两个xml文档的最佳/最快方法是什么?
What is the best/fastest way to merge two xml documents with ruby?
我有两个xml文件,一个已格式化,因此在视觉上很吸引人,一个未对整个节点中的某些节点进行一些更改(并且已删除注释和空格),并且经常更改.因此,我试图找出一种简单有效的解决方案,以检查已更改的内容(它们可能并不都具有ID),然后将旧文档与格式化的文档合并.
I have two xml files, one that's formatted so it is visually appealing, one that isn't (and it has comments and whitespaces stripped) that has a few changes to some of the nodes throughout, and it gets changed often. So I'm trying to figure out a simple and efficient solution to check what's changed (they may not all have IDs), and merge the old document with the formatted document.
推荐答案
Ara Howard几个月前发布了一个片段,用于比较XML文档: 比较XML .
Ara Howard posted a snippet a few months ago for comparing XML documents: Comparing XML.
这篇关于红宝石的XML差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!