Platinum Partner

Convert XML To JSON Using Ruby And ActiveSupport

// Convert XML to JSON using Ruby and ActiveSupport


#! /usr/bin/env ruby

require 'rubygems'
require 'active_support/core_ext'
require 'json'

xml = File.open(ARGV.first).read
json = Hash.from_xml(xml).to_json

File.open(ARGV.last, 'w+').write json
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}