diff options
author | Dan Pasanen <dan.pasanen@gmail.com> | 2015-11-21 03:51:10 -0600 |
---|---|---|
committer | Dan Pasanen <dan.pasanen@gmail.com> | 2015-11-21 03:51:27 -0600 |
commit | 16304977ca877f04b55b1f4a0848107f36af26ad (patch) | |
tree | 27b23808ce7cfcbed006fcf8707a5e0911847e8a /tree.c | |
parent | 8eadaf82488fe3c7a106bb17e335447bef5c9bec (diff) | |
parent | 6657afe83a38278f124ace71dc85f60420beb2d5 (diff) | |
download | android_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 |
Merge remote-tracking branch 'libxml2/master' into cm-13.0replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0E
Change-Id: Ie7fc53fdf2140f593e0d275ae7b445b4f4723551
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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; } } |