Skip to content

Instantly share code, notes, and snippets.

@OlegIlyenko
Created August 14, 2013 20:19
Show Gist options
  • Save OlegIlyenko/6235172 to your computer and use it in GitHub Desktop.
Save OlegIlyenko/6235172 to your computer and use it in GitHub Desktop.
Ruby script that checks whether 2 XML files are structurally same
#!/usr/bin/env ruby
require 'nokogiri'
require 'equivalent-xml'
xml = ARGV.map {|file_name| File.open(file_name) {|f| Nokogiri::XML(f)}}
print "Same: ", EquivalentXml.equivalent?(xml[0], xml[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment