From: brabuhr@... Date: 2010-09-21T00:35:49+09:00 Subject: Re: REXML advice - output I managed to mess-up clicking "Send" on Friday, so I'm trying again (-: > Stuart Clarke wrote: >> Robert Klemme wrote: >>> Stuart Clarke wrote: >>>> report.puts "Date: #{e.text}" >>>> Does anyone have any suggestions on a suitable workflow for this? >>> >>> Just iterate over all "ItemInfo" elements and print values from sub >>> elements (which you can select via a relative XPath). >> >> Thanks for getting back to me. I will look into this and see how I get >> on. > > I pulled this out of a script I use quite a bit and hacked your XPath into it: > > ARGV.each do |filename| >   doc = REXML::Document.new( File.new( filename ) ) > >   doc.elements.each("/UserData/List/ItemInfo"){|e| >    print e.elements["Title"].text, "\t" >    puts e.elements["Date"].text >  end > end