Skip to main content

node_get_content

Function node_get_content 

Source
pub unsafe fn node_get_content(node: *mut _xmlNode) -> *mut xmlChar
Expand description

Get the content of a node, recursively concatenating child text.

ยงUPSTREAM-PARITY

xmlChar *xmlNodeGetContent(const xmlNode *cur);

Oracle behavior (tree.c xmlNodeGetContent):

  • For text/CDATA nodes: returns the content directly.
  • For element nodes: recursively concatenates the string values of children (text and CDATA; entity references are expanded via their content when available).
  • For attribute nodes: returns the attribute value (first child).
  • For comments/PIs: returns the content field.
  • For documents: returns content of the root element.
  • Returns NULL on error, empty string for empty nodes.

Returns a newly allocated string; caller frees with xmlFree.