Results 1 to 3 of 3
Mar 7, 2009, 01:22 #1
- Join Date
- Aug 2003
- Southern California, United States
- 0 Post(s)
- 0 Thread(s)
Need help with forming a multidimension array from an XML parse.
My XML document is as follows (per SeeqPod API):
<?xml version='1.0' encoding='UTF-8' ?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" start="0" end="0" total="26" prev="None" next="1">
I just cant seem to make an array of @songs from it and I have tried with this code but I get no success:
xml = Net::HTTP.get(URI(url)) songs = REXML::Document.new xml @songs =  songs.elements.each('playlist/trackList/track') do |s| h =  %w[location title creator].each do |e| h[e] = s.elements[e].text end @songs << h end
Does anyone know what I am doing wrong? I have been fussing with this for hours...Have a good day.