Contents of a node in Nokogiri

Posted by Styggentorsken on Stack Overflow See other posts from Stack Overflow or by Styggentorsken
Published on 2010-03-26T15:15:04Z Indexed on 2010/05/04 14:18 UTC
Read the original article Hit count: 122

Filed under:
|
|
|

Is there a way to select all the contents of a node in Nokogiri?

<root>
    <element>this is <hi>the content</hi> of my æøå element</element>
</root>

The result of getting the content of /root/element should be this is <hi>the content</hi> of my æøå element

Edit:

It seems like the solution is simply to use myElement.inner_html(). The problem I had was in fact that I was relying on an old version of libxml2, which escaped all the special characters.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about ruby