# Hpricot strangeness

**URL:** <https://www.ruby-forum.com/t/hpricot-strangeness/128912>\
**Category:** Ruby\
**Created:** [February 12, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/hpricot-strangeness/128912 "2008-02-12T16:40:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [February 12, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/hpricot-strangeness/128912/1 "2008-02-12T16:40:36Z")

</div>

Hi,

Has anyone noticed the following gotcha/bug(?) with empty xml tags in  
hpricot: doc = Hpricot(“

aaaa
”) ;  
doc.at(“foo”) =\> {elem {elem “aaaa” }} versus =\>  
{emptyelem } for 

How to get around that?

thank you!  
david

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [February 12, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/hpricot-strangeness/128912/2 "2008-02-12T19:11:31Z")

</div>

On Wed, Feb 13, 2008 at 12:40:32AM +0900, D. Krmpotic wrote:

> Has anyone noticed the following gotcha/bug(?) with empty xml tags in  
> hpricot: doc = Hpricot(“
> 
> aaaa
> ”) ;  
> doc.at(“foo”) =\> {elem {elem “aaaa” }} versus =\>  
> {emptyelem } for 
> 
> How to get around that?

[http://code.whytheluckystiff.net/hpricot/wiki/HpricotXML](http://code.whytheluckystiff.net/hpricot/wiki/HpricotXML)

> thank you!  
> david  
> –Greg

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [February 12, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/hpricot-strangeness/128912/3 "2008-02-12T20:05:34Z")

</div>

Great, thanx… I did find this before, but somehow it didn’t work at the  
first try. I did something wrong I guess. thank you again

Gregory S. wrote:

> On Wed, Feb 13, 2008 at 12:40:32AM +0900, D. Krmpotic wrote:
> 
> > Has anyone noticed the following gotcha/bug(?) with empty xml tags in  
> > hpricot: doc = Hpricot(“
> > 
> > aaaa
> > ”) ;  
> > doc.at(“foo”) =\> {elem {elem “aaaa” }} versus =\>  
> > {emptyelem } for 
> > 
> > How to get around that?
> 
> [http://code.whytheluckystiff.net/hpricot/wiki/HpricotXML](http://code.whytheluckystiff.net/hpricot/wiki/HpricotXML)
> 
> > thank you!  
> > david  
> > –Greg
