[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Vaucher Bastien

2/21/2007 9:36:00 AM

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

--
Posted via http://www.ruby-....