# Help with libxml

**URL:** <https://www.ruby-forum.com/t/help-with-libxml/174022>\
**Category:** Rails\
**Created:** [August 19, 2009, 4:08pm UTC](https://www.ruby-forum.com/t/help-with-libxml/174022 "2009-08-19T16:08:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [August 19, 2009, 4:08pm UTC](https://www.ruby-forum.com/t/help-with-libxml/174022/1 "2009-08-19T16:08:18Z")

</div>

hi - i’m pulling my hair out. the find method simply won’t work for  
me.

here’s my xml doc:

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

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [August 19, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/help-with-libxml/174022/2 "2009-08-19T17:46:03Z")

</div>

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"?\>

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