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

V

Vaucher Bastien

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top