From: Keith Fahlgren Date: 2007-07-13T02:18:45+09:00 Subject: Re: XML file processing using REXML (beginner's question) On 7/12/07, Ronald Fischer wrote: > Hello! > > I try to understand REXML using the tutorial in Hi, You seem comfortable with XPath, so let me strongly encourage the methods defined in the REXML::XPath class instead of the []-based methods. http://www.germane-software.com/software/XML/rexml/doc/classes/REXML/XPath.html $ cat rbtalk.rb #!/usr/bin/env ruby require "rexml/document" source=< ENDXML doc = REXML::Document.new source REXML::XPath.each(doc, "/ns:toplevel/ns:request") {|element| puts element.attributes["requestID"] } p REXML::XPath.match(doc, "/ns:toplevel/ns:request[@requestID='2']") $ ruby ./rbtalk.rb 1 2 [ ... ] HTH, Keith