}
if (node->ns != NULL &&
strcmp(reinterpret_cast<const char *>(node->ns->href), "http://template.sesse.net/") == 0) {
- xmlNode *frag = xmlNewDocFragment(node->doc);
- xmlReplaceNode(node, frag);
- frag->children = node->children;
- frag->last = node->last;
+ while (node->children != NULL) {
+ xmlAddPrevSibling(node, node->children);
+ }
- node->children = node->last = NULL;
+ xmlUnlinkNode(node);
xmlFreeNode(node);
}
}