【发布时间】:2011-02-01 05:32:43
【问题描述】:
有没有办法在 Nokogiri 中选择一个节点的所有内容?
<root>
<element>this is <hi>the content</hi> of my æøå element</element>
</root>
获取/root/element的内容的结果应该是:
this is <hi>the content</hi> of my æøå element
编辑:
似乎解决方案只是使用myElement.inner_html()。我遇到的问题实际上是我依赖的是旧版本的 libxml2,它转义了所有特殊字符。
【问题讨论】: