* xmlAddNextSibling: * @prev: the target node * @cur: the new node * * Unlinks @cur and inserts it as next sibling after @prev. * * Unlike xmlAddChild this function does not merge text nodes. * * If @cur is an attribute node, it is inserted after attribute * @prev. If the attribute list contains an attribute with a name * matching @cur, the old attribute is destroyed. * * See the not
| 3187 | * if arguments are invalid or a memory allocation failed. |
| 3188 | */ |
| 3189 | xmlNodePtr |
| 3190 | xmlAddNextSibling(xmlNodePtr prev, xmlNodePtr cur) { |
| 3191 | if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) || |
| 3192 | (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) || |
| 3193 | (cur == prev)) |
| 3194 | return(NULL); |
| 3195 | |
| 3196 | if (cur == prev->next) |
| 3197 | return(cur); |
| 3198 | |
| 3199 | return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0)); |
| 3200 | } |
| 3201 | |
| 3202 | #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ |
| 3203 | defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) |
no test coverage detected