* 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. */
| 5878 | * Returns the first text node augmented or NULL in case of error. |
| 5879 | */ |
| 5880 | xmlNodePtr |
| 5881 | xmlTextMerge(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 | /** |
nothing calls this directly
no test coverage detected