Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [libxml] NoMethodError for XML::Node::Set

Thread Tools

[libxml] NoMethodError for XML::Node::Set

Vaucher Bastien
Posts: n/a
I just began using libxml and I wanted to find the "body" tag in a xhtml
file, so i tried this :

doc = XML:ocument.file(@file)
root = doc.root
nodeset = @root.find("body")
node = nodeset.first

but when I execute the code I get this error message :

NoMethodError: undefined method `first' for #<XML::Node::Set:0x330c624>

Does someone know where this could come from ? And how to make sure it's
installed correctly ?
To install it I used darwinport and when I look at the installed
librairies, I see that :
libiconv @1.11_4+darwin_8 (active)
libxml @1.8.17_0 (active)
libxml2 @2.6.27_0 (active)
rb-libxml2 @0.3.6_0 (active)
rb-rubygems @0.9.1_0 (active)
ruby @1.8.5-p12_0 (active)
zlib @1.2.3_0 (active)

Thanks for your help

Posted via

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
wsdl2ruby NoMethodError Giedrius Ruby 2 03-05-2006 01:29 PM
Ruby On Rails, NoMethodError 'rewrite' Peter Barry Ruby 0 10-18-2005 11:46 AM
ActionMailer NoMethodError 'deliver' enspired Ruby 3 07-28-2005 03:18 PM
NoMethodError in Range#include? Levin Alexander Ruby 11 07-14-2005 02:47 PM
[BUG?] NoMethodError in REXML::Xpath.match in Ruby 1.9 Alexey Verkhovsky Ruby 0 08-03-2004 05:51 AM