Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ruby convert xml to yaml
require 'active_support/core_ext/hash/conversions'
require 'yaml'
file = File.open("data/mconvert.xml", "r")
hash = Hash.from_xml(file.read)
yaml = hash.to_yaml
File.open("data/mirador.yml", "w") { |file| file.write(yaml) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment