Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xml diff in ruby? [closed]

Tags:

merge

diff

xml

ruby

What is the best/fastest way to merge two xml documents with ruby?

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.

like image 892
Lance Avatar asked Oct 05 '09 02:10

Lance


2 Answers

Ara Howard posted a snippet a few months ago for comparing XML documents: Comparing XML.

like image 97
Andy Stewart Avatar answered Sep 27 '22 15:09

Andy Stewart


There's a gem for this equivalent-xml

like image 22
SoobAeroDude Avatar answered Sep 27 '22 17:09

SoobAeroDude