MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlTextMerge

Function xmlTextMerge

ThirdParty/libxml2/vtklibxml2/tree.c:5880–5894  ·  view source on GitHub ↗

* xmlTextMerge: * @first: the first text node * @second: the second text node being merged * * Merge the second text node into the first. The second node is * unlinked and freed. * * Returns the first text node augmented or NULL in case of error. */

Source from the content-addressed store, hash-verified

5878 * Returns the first text node augmented or NULL in case of error.
5879 */
5880xmlNodePtr
5881xmlTextMerge(xmlNodePtr first, xmlNodePtr second) {
5882 if ((first == NULL) || (first->type != XML_TEXT_NODE) ||
5883 (second == NULL) || (second->type != XML_TEXT_NODE) ||
5884 (first == second) ||
5885 (first->name != second->name))
5886 return(NULL);
5887
5888 if (xmlTextAddContent(first, second->content, -1) < 0)
5889 return(NULL);
5890
5891 xmlUnlinkNodeInternal(second);
5892 xmlFreeNode(second);
5893 return(first);
5894}
5895
5896#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
5897/**

Callers

nothing calls this directly

Calls 3

xmlTextAddContentFunction · 0.85
xmlUnlinkNodeInternalFunction · 0.85
xmlFreeNodeFunction · 0.85

Tested by

no test coverage detected