dinsdag 13 mei 2008

Rails : how to parse xml from url

require 'open-uri'
xmlfile = open('http://xmlfiles.com/file.xml').read

puts xmlfile['root']['item'].first['id'] # => gets you the first id of the xml file

Geen opmerkingen: