Mega Code Archive
Categories
/
Ruby
/
XML
Each loop on element
xml = %{
} require 'rexml/document' doc = REXML::Document.new xml p doc.elements.each('//fish') { |f| puts f.attribute('color') }