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

Discussion in 'Ruby' started by Vaucher Bastien, Feb 21, 2007.

  1. 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-forum.com/.
    Vaucher Bastien, Feb 21, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,399
  2. Ian Gregory
    Replies:
    1
    Views:
    495
  3. Olav
    Replies:
    3
    Views:
    4,207
  4. Tjerk Wolterink
    Replies:
    2
    Views:
    1,399
    Dimitre Novatchev
    Aug 24, 2006
  5. Kuba Podgorski

    libxml (XML::Node.content)

    Kuba Podgorski, Jul 23, 2007, in forum: Ruby
    Replies:
    0
    Views:
    127
    Kuba Podgorski
    Jul 23, 2007
Loading...

Share This Page