Skip to content

Instantly share code, notes, and snippets.

@diegodap
Created April 1, 2014 18:31
Show Gist options
  • Select an option

  • Save diegodap/9920137 to your computer and use it in GitHub Desktop.

Select an option

Save diegodap/9920137 to your computer and use it in GitHub Desktop.
XML
require "rexml/document"
doc = REXML::Document.new File.read("#{Rails.root}/app/views/xml/alunos.xml")
doc = REXML::Document.new File.open(File.dirname(__FILE__) + '/alunos.xml')
doc.elements.each("alunos/aluno") do |i|
puts "#{i.elements['nome'].text}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment