Source

perl-XML-LibXML / dom.c

Diff from to
         xmlSetTreeDoc(return_node, doc);
     }
 
-    if ( doc != NULL && return_node != NULL ) {
+    if ( doc != NULL 
+         && return_node != NULL
+         && return_node->type != XML_ENTITY_REF_NODE ) {
         xmlReconciliateNs(doc, return_node);     
     }
 
         newChild->parent= self;
     }
  
-    xmlReconciliateNs(self->doc, newChild);     
+    if ( newChild->type != XML_ENTITY_REF_NODE ) {
+        xmlReconciliateNs(self->doc, newChild);     
+    }
 
     return newChild;
 }
     }
     
     domAddNodeToList(newChild, refChild->prev, refChild);
-    xmlReconciliateNs(self->doc, newChild);     
+    if ( newChild->type != XML_ENTITY_REF_NODE ) {
+        xmlReconciliateNs(self->doc, newChild);     
+    }
 
     return newChild;
 }
     }
 
     domAddNodeToList(newChild, refChild, refChild->next);
-    xmlReconciliateNs(self->doc, newChild);     
+    if ( newChild->type != XML_ENTITY_REF_NODE ) {
+        xmlReconciliateNs(self->doc, newChild);     
+    }
 
     return newChild;
 }
         domAddNodeToList( newNode, prev,  next );
     }
 
-    xmlReconciliateNs(newNode->doc, newNode); 
+    if ( newNode->type != XML_ENTITY_REF_NODE ) {
+        xmlReconciliateNs(newNode->doc, newNode); 
+    }
 
     return oldNode;
 }