Created
April 13, 2011 03:57
-
-
Save rjfranco/916942 to your computer and use it in GitHub Desktop.
Attempting to do Each on XML object created using XmlSimple Gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'rubygems' | |
require 'xmlsimple' | |
=begin | |
Sample Object in XML | |
<?xml version="1.0" encoding="UTF-8"?> | |
<ADS> | |
<AD> | |
<JOB_ID>401448</JOB_ID> | |
<DATE_POSTED>2011-04-13</DATE_POSTED> | |
<DATE_EXPIRE>2011-05-13</DATE_EXPIRE> | |
<CLASS>S305</CLASS> | |
<FIELDS> | |
<EVENTNAME>Columbia Dance Summer Moves! Dance Camp</EVENTNAME> | |
<DATEHours>06/27/11-07/01/11 M-F 9:30-3:00pm</DATEHours> | |
<Cost>$275.00</Cost> | |
<AgeGroup>4-6</AgeGroup> | |
<Location>1700 Broadway St., Vancouver WA</Location> | |
<Contact></Contact> | |
</FIELDS> | |
<ADTEXT><B> Columbia Dance Summer Moves! Dance Camp<BR> </B> <B> Ages: </B>4-6<BR> <B> Time & Dates: </B> 06/27/11-07/01/11 M-F 9:30-3:00pm<BR> <B> Cost: </B>$275.00<BR> <B> Location: </B>1700 Broadway St., Vancouver WA<BR> <B> Description: <BR> </B>Join us this summer and enjoy as we explore. We will have Creative Dance, Ballet and Modern techniques, wonderful dance art projects, choreography, videos, stories, dance games and a final exciting performance for families and friends. </ADTEXT> | |
</AD> | |
</ADS> | |
=end | |
xmldata = XmlSimple.xml_in('summercamp-2011-data.xml') | |
xmldata['AD'].each do |ad| | |
puts ad[JOB_ID] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment