Basically you can just create a Document by passing in the xml as a
string (response.body probably). Then you get the root element and pull
what you want out of the doc via xpaths.
Or, if you just need to convert all the content into a nested hash, see
below.
Gustav P. wrote:
Cheers,
Gustav P.
That cobra thingy looks interesting… will have to check it out. But
you’re right that rails will do this now (I think added as part of the
REST support in 1.2).
Rails adds a from_xml class method to Hash:
~/rails/whitelabel $ script/console
Loading development environment.
h = Hash.from_xml “hellothere”
=> {“foo”=>{“baz”=>“there”, “bar”=>“hello”}}
friendly and easy to use. There will undoubtedly be similar projects out
there (possibly even something in rails?) but in my experience this has
been excellent.