From: Markus Jais Date: 2002-01-27T10:13:34+09:00 Subject: Re: REXML: stream parsing question tgphelps@iglou.com wrote: > Shouldn't it be "method_missing", instead of "method_messing"? Of course. sometimes my eyes and my brain just do not work together :-) maybe this was because I wrote the code at 4.00 a.m. thanks for pointing my to the typo markus > > -----Original Message----- > From: Markus Jais > To: ruby-talk@ruby-lang.org (ruby-talk ML), undisclosed-recipients: ; > Date: Sun, 27 Jan 2002 03:13:12 +0900 > Subject: REXML: stream parsing question > >> Hello, >> >> I have this piece of code: >> >> require "rexml/document" >> include REXML >> >> class MyListener >> def tag_start name, attrs >> print "start name: ",name.strip, "\n" >> print "start attrs: ",attrs, "\n" >> end >> def tag_end name >> puts "end: ", name.strip, "\n" >> end >> >> def text(text) >> print "text: ", text.strip, "\n" >> end >> >> def method_messing(methId) >> puts methId.idname >> end >> end >> ml = MyListener.new >> Document.parse_stream(File.new("bla.xml"), ml) >> >> it works just fine: >> but when I comment the >> def text(text) >> method out, I get the following error: >> >> /usr/local/lib/ruby/site_ruby/1.6/rexml/text.rb:76:in `parse_stream': >> undefined method `text' for # (NameError) >> from /usr/local/lib/ruby/site_ruby/1.6/rexml/element.rb:394:in >> `parse_stream' >> from /usr/local/lib/ruby/site_ruby/1.6/rexml/document.rb:179:in >> `parse_stream' >> from ./stream.rb:29 >> >> does anybody know what I did wrong. I thought it would jump into >> "method_messing". >> I have REXML 1.2.5 >> >> markus >> >> >> >>