Loading development environment (Rails 2.3.3)
require 'xml'
>> require 'xml'
=> []
>> doc = XML::Document.file("public/my.xml")
=> <?xml version="1.0" encoding="UTF-8"?>
<top>
  <first>
    <second>
    </second>
  </first>
</top>

>> nodes = doc.find('/top/first')
=> #<LibXML::XML::XPath::Object:0x282c3bc>
>> nodes.each do |node|
?> puts node
>> end
<first>
    <second>
    </second>
  </first>
=> #<LibXML::XML::XPath::Object:0x282c3bc>
>>

On Aug 19, 10:07 am, "dino d." <[email protected]> wrote:
> hi - i'm pulling my hair out. the find method simply won't work for
> me.
>
> here's my xml doc:
>
> <top>
> <first>
> <second>
> </second>
> </first>
> </top>
>
> that's it.  now after parsing, i do
>
> doc.find('/top/first')
>
> and i get a result with size 0.  i've tried everything.  is there a
> trick to using libxml that i'm missing?
>
> thanks, for any help,
> dino
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to