xmlReplaceNode(node, frag);
frag->children = node->children;
frag->last = node->last;
+
+ node->children = node->last = NULL;
+ xmlFreeNode(node);
}
}
void Substitute::process(xmlNode *node, bool clean)
{
- for (xmlNode *child = node->children; child != NULL; child = child->next) {
+ xmlNode *next_child;
+ for (xmlNode *child = node->children; child != NULL; child = next_child) {
+ next_child = child->next;
bool processed = false;
if (child->type == XML_ELEMENT_NODE) {
}
}
}
-
+
if (!processed) {
process(child, clean);
}