From: Ross Bamford Date: 2006-05-08T01:02:02+09:00 Subject: Re: xml/libxml "first" method doesn't work On Sun, 2006-05-07 at 04:40 +0900, Ingo Weiss wrote: > Hello, > > I am having a problem with the xml/libxml Ruby Gem > > doc = XML::Document.file('myfile.xml') > mynodes = doc.find('[xpath statement here]') > mynodes.length > => 20 > mynodes.first > => NoMethodError: undefined method `first' for > # > > The Doc does mention a "first" method for XML::Node::Set. Is this a bug? This method was introduced in the recent 0.3.8 release, so you may need to upgrade from an older version. require 'xml/libxml' XML::Parser::VERSION # => "0.3.8" doc = XML::Document.file('safs/testlog.xml') set = doc.find('//log_message') # => [...] set.length # => 3 set.first # => [...] -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk