1.1 --- a/libxml2dom/__init__.py Sun Mar 25 01:57:53 2007 +0000
1.2 +++ b/libxml2dom/__init__.py Sun Mar 25 01:59:19 2007 +0000
1.3 @@ -20,7 +20,7 @@
1.4 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
1.5 """
1.6
1.7 -__version__ = "0.4.1"
1.8 +__version__ = "0.4.2"
1.9
1.10 from libxml2dom.macrolib import *
1.11 from libxml2dom.macrolib import \
1.12 @@ -71,8 +71,9 @@
1.13 methods.
1.14 """
1.15
1.16 - def __init__(self, node):
1.17 + def __init__(self, node, impl):
1.18 self.node = node
1.19 + self.impl = impl
1.20
1.21 def getNamedItem(self, name):
1.22 return self.node.getAttributeNode(name)
1.23 @@ -196,7 +197,7 @@
1.24 return NodeList([self.impl.get_node(_node, self) for _node in Node_childNodes(self._node)])
1.25
1.26 def _attributes(self):
1.27 - return NamedNodeMap(self)
1.28 + return NamedNodeMap(self, self.impl)
1.29
1.30 def _namespaceURI(self):
1.31 return Node_namespaceURI(self._node)
1.32 @@ -464,7 +465,10 @@
1.33
1.34 def __init__(self, node, impl):
1.35 self._node = node
1.36 - self.impl = impl
1.37 + self.implementation = self.impl = impl
1.38 +
1.39 + def _documentElement(self):
1.40 + return self.xpath("*")[0]
1.41
1.42 def _ownerDocument(self):
1.43 return self
1.44 @@ -473,6 +477,7 @@
1.45 #print "Freeing document", self._node
1.46 libxml2mod.xmlFreeDoc(self._node)
1.47
1.48 + documentElement = property(_documentElement)
1.49 ownerDocument = property(_ownerDocument)
1.50
1.51 class DocumentType(object):