Skip to content

Instantly share code, notes, and snippets.

@sethladd
Created January 8, 2009 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethladd/44830 to your computer and use it in GitHub Desktop.
Save sethladd/44830 to your computer and use it in GitHub Desktop.
example ruby and libxml code
require 'rubygems'
require 'libxml'
doc = LibXML::XML::Document.file('test.xml')
rs = doc.find('//R')
rs.each do |r|
u = r.find_first('U')
s = r.find_first('S')
puts "S: #{s} and U: #{u}"
end
rs = nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment