diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-12-19 00:08:35 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-12-19 00:09:03 +0100 |
commit | f54d6a929af2a570396f0595a0e29064c908c12e (patch) | |
tree | 00be7bfb4b3e1c92ddb614e0aff09c56735f6362 | |
parent | 7580ce0a7f53891de520fed2c0e360266c286da6 (diff) | |
download | libxml2-f54d6a929af2a570396f0595a0e29064c908c12e.tar.gz |
Account for ID attributes in xmlSetTreeDoc
-rw-r--r-- | tree.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2799,8 +2799,19 @@ 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); + + if (xmlIsID(doc, tree, prop)) { + xmlChar *idVal = xmlNodeListGetString(doc, prop->children, + 1); + xmlAddID(NULL, doc, idVal, prop); + } + prop = prop->next; } } |