From: Tobias Reif Date: 2001-11-18T03:56:37+09:00 Subject: [ruby-talk:25720] Re: REXML: node.type, .parent, .name Sean Russell wrote: > element.elements.each do |elem_child| > # elem_child is guaranteed to be an Element > parent_name = elem_child.parent.name > name = elem_child.name > end thanks > parent.each do |child| > case child.type > when Element > puts "Element" > when Text > puts "Text" > when CData > puts "CData" > when Comment > puts "Comment" > end > puts child.parent.type > end processing instructions too? > If you check the inheritance tree (in the documentation) you'll see a > module called "Namespace". All classes that include Namespace have a > "name" method. All subclasses of Child have a parent method. didn't find that; my fault. > The documentation is really helpful if you want to find out about these > methods. sorry; I browsed the documentation, but obviously not thoroughly enough. Thanks for youl help. Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/