Cobra vs Mongoose translates XML to and from Ruby Hash objects,
following the BadgerFish (http://badgerfish.ning.com/) convention.
Usage
Converting XML to a Ruby Hash
require ‘cobravsmongoose’
xml = ‘charliedavid’
CobraVsMongoose.xml_to_hash(xml)
=> { “alice” => { “bob” => [{ “$” => “charlie” }, { “$” => “david” }]
} }
Converting a Ruby Hash to XML
require ‘cobravsmongoose’
hash = { “alice” => { “$” => “bob”, “@charlie” => “david” } }
CobraVsMongoose.hash_to_xml(hash)
=> “bob”
More information is available on the RubyForge page:
http://cobravsmongoose.rubyforge.org/
Paul.