I'm using REXML library.
<foo>
  <baa>value<baa>
<foo>
I want to get value belongs to baa.
How to code it ?
try this
require 'rexml/document'
doc = REXML::Document.new File.new('mydoc.xml')
doc.elements('*/foo/baa') { |element| puts element.get_text }
I prefer Nokogiri and Hpricot gems myself. You can try them if you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With