Permalink
Browse files

Preserve attributes of include start on tree copy

* tree.c: copy attributes and namespaces for that kind of node
  • Loading branch information...
1 parent 928d703 commit 2afca4a1c4964be7b37326d365a2a625c3a38c7e Petr Pajas committed with veillard Jul 30, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 tree.c
View
6 tree.c
@@ -4169,7 +4169,8 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
if (!extended)
goto out;
- if ((node->type == XML_ELEMENT_NODE) && (node->nsDef != NULL))
+ if (((node->type == XML_ELEMENT_NODE) ||
+ (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL))
ret->nsDef = xmlCopyNamespaceList(node->nsDef);
if (node->ns != NULL) {
@@ -4196,7 +4197,8 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
ret->ns = ns;
}
}
- if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL))
+ if (((node->type == XML_ELEMENT_NODE) ||
+ (node->type == XML_XINCLUDE_START)) && (node->properties != NULL))
ret->properties = xmlCopyPropList(ret, node->properties);
if (node->type == XML_ENTITY_REF_NODE) {
if ((doc == NULL) || (node->doc != doc)) {

0 comments on commit 2afca4a

Please sign in to comment.