Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/xml/dom/minidom.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ class Attr(Node):
def __init__(self, qName, namespaceURI=EMPTY_NAMESPACE, localName=None,
prefix=None):
self.ownerElement = None
self.ownerDocument = None
self._name = qName
self.namespaceURI = namespaceURI
self._prefix = prefix
Expand Down Expand Up @@ -689,6 +690,7 @@ class Element(Node):

def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None,
localName=None):
self.ownerDocument = None
self.parentNode = None
self.tagName = self.nodeName = tagName
self.prefix = prefix
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Add the *ownerDocument* attribute to :mod:`xml.dom.minidom` elements and attributes
created by directly instantiating the ``Element`` or ``Attr`` class. Note that
this way of creating nodes is not supported; creator functions like
:py:meth:`xml.dom.Document.documentElement` should be used instead.
Loading