RXML to HASH

A

a marc aurele

basicaly i receive a xml response from the internet
and i would like to convert the xml structure into
an HASH object . Theres probably a lot of ways
to get this done but im curious to see if theres a gem
or RUBY way of doing this directly .. thanks all. =]
 
E

Ezra Zygmuntowicz

basicaly i receive a xml response from the internet
and i would like to convert the xml structure into
an HASH object . Theres probably a lot of ways
to get this done but im curious to see if theres a gem
or RUBY way of doing this directly .. thanks all. =]



$ sudo gem install xml-simple

require 'rubygems'
require 'xmlsimple'
file = "/some/file.xml"
xml = XmlSimple.xml_in File.open(file).read, {'KeepRoot' => true}


Cheers-
- Ezra Zygmuntowicz
-- Founder & Software Architect
-- (e-mail address removed)
-- EngineYard.com
 
A

a marc aurele

$ sudo gem install xml-simple

require 'rubygems'
require 'xmlsimple'
file = "/some/file.xml"
xml = XmlSimple.xml_in File.open(file).read, {'KeepRoot' => true}


Cheers-
- Ezra Zygmuntowicz

thanks. Do you know that i tried to do this by hand instead.
im still bashing my head on the table .. cyas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,285
Messages
2,571,416
Members
48,108
Latest member
Virus9283

Latest Threads

Top