1.1 --- a/libxml2dom/macrolib/macrolib.py Sun Apr 08 22:51:59 2007 +0000
1.2 +++ b/libxml2dom/macrolib/macrolib.py Sun Apr 08 22:52:05 2007 +0000
1.3 @@ -49,10 +49,6 @@
1.4 else:
1.5 return s
1.6
1.7 -def check_document(node, tmp):
1.8 - if Node_ownerDocument(tmp) is not None and Node_ownerDocument(node) is not Node_ownerDocument(tmp):
1.9 - raise xml.dom.DOMException(xml.dom.WRONG_DOCUMENT_ERR)
1.10 -
1.11 def get_ns(ns):
1.12 out_ns = to_unicode(libxml2mod.xmlNodeGetContent(ns))
1.13 # Detect "" and produce None as the empty namespace.
1.14 @@ -162,6 +158,9 @@
1.15 for label, value in _nodeTypes.items():
1.16 _reverseNodeTypes[value] = label
1.17
1.18 +def Node_equals(node, other):
1.19 + return libxml2mod.xmlXPathCmpNodes(node, other) == 0
1.20 +
1.21 def Node_ownerDocument(node):
1.22 return libxml2mod.doc(node)
1.23
1.24 @@ -417,15 +416,12 @@
1.25 return libxml2mod.xmlNewCDataBlock(Node_ownerDocument(node), value, len(value))
1.26
1.27 def Node_insertBefore(node, tmp, oldNode):
1.28 - check_document(node, tmp)
1.29 return libxml2mod.xmlAddPrevSibling(oldNode, tmp)
1.30
1.31 def Node_replaceChild(node, tmp, oldNode):
1.32 - check_document(node, tmp)
1.33 return libxml2mod.xmlReplaceNode(oldNode, tmp)
1.34
1.35 def Node_appendChild(node, tmp):
1.36 - check_document(node, tmp)
1.37 return libxml2mod.xmlAddChild(node, tmp)
1.38
1.39 def Node_removeChild(node, child):