From: Marc Hoeppner Date: 2008-01-14T21:07:36+09:00 Subject: Re: Stream Parsing with REXML Ok, I am still on this and am starting to feel a bit stupid...I guess there is something wrong with the following example, but maybe I should step back for a while. Anyhow - what's missing to make it work: The xml file: Gene1 1 10 Gene2 11 20 Gene3 21 30 Gene4 31 40 Gene5 41 50 The code: data = File.new(ARGV.shift) class Listener def tag_start( name, attr_hash ) if name == 'Gene-ref' @name = name end end def text( str ) end def tag_end( name ) if name == 'Gene-ref' puts @name @name = nil end end end require 'rexml/document' REXML::Document.parse_stream( data, Listener.new ) -- Posted via http://www.ruby-forum.com/.