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

I just began using libxml and I wanted to find the “body” tag in a xhtml
file, so i tried this :

doc = XML::Document.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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs