From: James Britt Date: 2005-08-29T08:02:26+09:00 Subject: Re: Help needed with rexml Trans wrote: > Written off teh top of my head, but you could write your own. > > class REXML::Element > def each_element_recurse > each_element { |e| > unless e.children.empty? rescue false > e.each_element_recurse > end > yield(e) > end > end > > I made a first stab at it b/c I will probably need it myself soon. > > (Yes, I know I'm reopening a standard class! :-p) If you really think you need to visit every element you may be better off using the stream or pull parsers. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys