Topic: XML to Hash

I've parsed an XML-document using Hpricot and would like to convert it to JSON. Form what I understand I have to convert it to a hash first, then convert it to JSON.

Does anyone have any idea how to convert XML to a hash?

Thanks!

Re: XML to Hash

Hash.from_xml  should do the trick.  I read about it here: http://archives.ryandaigle.com/articles … h-from-xml

Re: XML to Hash

Also, someone else has used Hpricot to do the 'same' thing here: http://refactormycode.com/codes/932-cre … ng-hpricot