aboutsummaryrefslogtreecommitdiffstats
path: root/tree.c
diff options
context:
space:
mode:
authorDan Pasanen <dan.pasanen@gmail.com>2015-11-21 03:51:10 -0600
committerDan Pasanen <dan.pasanen@gmail.com>2015-11-21 03:51:27 -0600
commit16304977ca877f04b55b1f4a0848107f36af26ad (patch)
tree27b23808ce7cfcbed006fcf8707a5e0911847e8a /tree.c
parent8eadaf82488fe3c7a106bb17e335447bef5c9bec (diff)
parent6657afe83a38278f124ace71dc85f60420beb2d5 (diff)
downloadandroid_external_libxml2-replicant-6.0-0001.tar.gz
android_external_libxml2-replicant-6.0-0001.tar.bz2
android_external_libxml2-replicant-6.0-0001.zip
Change-Id: Ie7fc53fdf2140f593e0d275ae7b445b4f4723551
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tree.c b/tree.c
index 6ec92236..6a158cec 100644
--- a/tree.c
+++ b/tree.c
@@ -2799,8 +2799,27 @@ xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) {
if(tree->type == XML_ELEMENT_NODE) {
prop = tree->properties;
while (prop != NULL) {
+ if (prop->atype == XML_ATTRIBUTE_ID) {
+ xmlRemoveID(tree->doc, prop);
+ }
+
prop->doc = doc;
xmlSetListDoc(prop->children, doc);
+
+ /*
+ * TODO: ID attributes should be also added to the new
+ * document, but this breaks things like xmlReplaceNode.
+ * The underlying problem is that xmlRemoveID is only called
+ * if a node is destroyed, not if it's unlinked.
+ */
+#if 0
+ if (xmlIsID(doc, tree, prop)) {
+ xmlChar *idVal = xmlNodeListGetString(doc, prop->children,
+ 1);
+ xmlAddID(NULL, doc, idVal, prop);
+ }
+#endif
+
prop = prop->next;
}
}