This is a two-step thing. First you need to extract the XML file. If it is provided by the user through a form that you are lucky with, you need to extract it using the standard HTTP lib ruby ββor otherwise some gem, for example, mechanization (which is really really wonderful).
The second thing is very simple. You read the whole XML into a string, and then you can convert it to a hash with this point in code:
Hash.from_xml(xml_string)
Then you can analyze and work with the data ...
davidb
source share