[Lxml-checkins] r39360 - lxml/branch/nscleanup/src/lxml

scoder at codespeak.net scoder at codespeak.net
Sat Feb 24 17:06:15 CET 2007


Author: scoder
Date: Sat Feb 24 17:06:11 2007
New Revision: 39360

Modified:
   lxml/branch/nscleanup/src/lxml/proxy.pxi
Log:
cleanup

Modified: lxml/branch/nscleanup/src/lxml/proxy.pxi
==============================================================================
--- lxml/branch/nscleanup/src/lxml/proxy.pxi	(original)
+++ lxml/branch/nscleanup/src/lxml/proxy.pxi	Sat Feb 24 17:06:11 2007
@@ -181,38 +181,9 @@
     tree.xmlFreeDoc(c_doc)
 
 ################################################################################
-# change _Document references when a node changes documents
+# fix _Document references and namespaces when a node changes documents
 
 cdef void moveNodeToDocument(_NodeBase node, _Document doc):
-    """For a node and all nodes below, change document.
-
-    A node can change document in certain operations as an XML
-    subtree can move. This updates all possible proxies in the
-    tree below (including the current node). It also reconciliates
-    namespaces so they're correct inside the new environment.
-    """
-    _moveNodeToDocument(node, doc)
-##     tree.xmlReconciliateNs(doc._c_doc, node._c_node)
-##     if node._doc is not doc:
-##         node._doc = doc
-##         changeDocumentBelow(node._c_node, doc)
-
-cdef void changeDocumentBelow(xmlNode* c_parent, _Document doc):
-    """Update the Python references in the tree below the node.
-    Does not update the node itself.
-
-    Note that we expect C pointers to the document to be updated already by
-    libxml2.
-    """
-    cdef xmlNode* c_node
-    c_node = c_parent.children
-    tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
-    if c_node._private is not NULL:
-        (<_NodeBase>c_node._private)._doc = doc
-    tree.END_FOR_EACH_ELEMENT_FROM(c_node)
-
-
-cdef void _moveNodeToDocument(_NodeBase node, _Document doc):
     """Fix the xmlNs pointers of a node and its subtree that were moved.
 
     Mainly copied from libxml2's xmlReconciliateNs().  Expects libxml2 doc


More information about the lxml-checkins mailing list