/* * call-seq: * outer_xml * * Read the current node and its contents, including child nodes and markup. * Returns a utf-8 encoded string. */ static VALUE outer_xml(VALUE self) { xmlTextReaderPtr reader; xmlChar *value; VALUE str = Qnil; Data_Get_Struct(self, xmlTextReader, reader); value = xmlTextReaderReadOuterXml(reader); if(value) { str = NOKOGIRI_STR_NEW2((char*)value); xmlFree(value); } return str; }