How do I add text to an empty element in Hpricot?

Posted by Hates_ on Stack Overflow See other posts from Stack Overflow or by Hates_
Published on 2010-04-02T15:37:35Z Indexed on 2010/04/02 15:43 UTC
Read the original article Hit count: 182

Filed under:
|

If I have an empty tag:

<tag/>

How can I add text so that I end up with:

<tag>Hello World!</tag>

I can only seem to swap the whole tag with different content or add content before/after it.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about hpricot