fix the xmlStrdup() used in the previous patch. added --dropdtd fixed
* valid.c: fix the xmlStrdup() used in the previous patch.
* valid.c: added --dropdtd
* tree.c: fixed xmlUnlinkNode so it also removes the references
from the document if the node is a DTD
Daniel
diff --git a/tree.c b/tree.c
index 56a11a1..9d0bc9a 100644
--- a/tree.c
+++ b/tree.c
@@ -2486,6 +2486,14 @@
#endif
return;
}
+ if (cur->type == XML_DTD_NODE) {
+ xmlDocPtr doc;
+ doc = cur->doc;
+ if (doc->intSubset == (xmlDtdPtr) cur)
+ doc->intSubset = NULL;
+ if (doc->extSubset == (xmlDtdPtr) cur)
+ doc->extSubset = NULL;
+ }
if ((cur->parent != NULL) && (cur->parent->children == cur))
cur->parent->children = cur->next;
if ((cur->parent != NULL) && (cur->parent->last == cur))