dino_d
(dino d.)
1
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
Rick3
(Rick)
2
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>