Skip to content

Instantly share code, notes, and snippets.

@ravicious
Created December 21, 2008 21:19
Show Gist options
  • Save ravicious/38768 to your computer and use it in GitHub Desktop.
Save ravicious/38768 to your computer and use it in GitHub Desktop.
require 'rexml/document'
xml = REXML::Document.new(File.open("list.xml"))
quantity = 0
xml.elements.each("//item") { quantity += 1 }
puts quantity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment