Skip to main content

doc_set_root_element

Function doc_set_root_element 

Source
pub unsafe fn doc_set_root_element(
    doc: *mut _xmlDoc,
    root: *mut _xmlNode,
) -> *mut _xmlNode
Expand description

Set the root element of a document.

§UPSTREAM-PARITY

xmlNodePtr xmlDocSetRootElement(xmlDocPtr doc, xmlNodePtr root);

If the document already has a root element, the old root is returned. The new root is added as a child of the document.

§SAFETY

  • doc must be a valid pointer to an _xmlDoc.
  • root must be a valid pointer to an _xmlNode, or NULL.