Method: LibXML::XML::Document#root

Defined in:
ext/libxml/ruby_xml_document.c

#rootObject

Obtain the root node.



503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'ext/libxml/ruby_xml_document.c', line 503

static VALUE rxml_document_root_get(VALUE self)
{
  xmlDocPtr xdoc;

  xmlNodePtr root;

  Data_Get_Struct(self, xmlDoc, xdoc);
  root = xmlDocGetRootElement(xdoc);

  if (root == NULL)
    return (Qnil);

  return rxml_node_wrap(root);
}