Method: Nokogiri::XML::Node#content

Defined in:
ext/nokogiri/xml_node.c

#contentObject Also known as: text, inner_text

Returns the plaintext content for this Node. Note that entities will always be expanded in the returned string.


1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
# File 'ext/nokogiri/xml_node.c', line 1166

static VALUE
get_native_content(VALUE self)
{
  xmlNodePtr node;
  xmlChar *content;

  Data_Get_Struct(self, xmlNode, node);

  content = xmlNodeGetContent(node);
  if (content) {
    VALUE rval = NOKOGIRI_STR_NEW2(content);
    xmlFree(content);
    return rval;
  }
  return Qnil;
}