summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-07-04 06:25:53 (GMT)
committerFred Drake <fdrake@acm.org>2001-07-04 06:25:53 (GMT)
commitfbe7b4fc8c48aa722ef4838182091d1aac75681d (patch)
tree3bb176fc6da9831bc461f320e5dbeda1c90ef975
parentec3dfdee6a09e1ad8d4e319876d0cf7691397245 (diff)
downloadcpython-fbe7b4fc8c48aa722ef4838182091d1aac75681d.zip
cpython-fbe7b4fc8c48aa722ef4838182091d1aac75681d.tar.gz
cpython-fbe7b4fc8c48aa722ef4838182091d1aac75681d.tar.bz2
Make the implementations of getElementsByTagName() and
getElementsByTagNameNS() consistent in form as well as functionality (cosmetic).
-rw-r--r--Lib/xml/dom/minidom.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 59f86a7..d440045 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -551,9 +551,7 @@ class Element(Node):
return _getElementsByTagNameHelper(self, name, [])
def getElementsByTagNameNS(self, namespaceURI, localName):
- rc = []
- _getElementsByTagNameNSHelper(self, namespaceURI, localName, rc)
- return rc
+ return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
def __repr__(self):
return "<DOM Element: %s at %s>" % (self.tagName, id(self))
@@ -881,15 +879,11 @@ class Document(Node):
a.value = ""
return a
- def getElementsByTagNameNS(self, namespaceURI, localName):
- rc = []
- _getElementsByTagNameNSHelper(self, namespaceURI, localName, rc)
- return rc
-
def getElementsByTagName(self, name):
- rc = []
- _getElementsByTagNameHelper(self, name, rc)
- return rc
+ return _getElementsByTagNameHelper(self, name, [])
+
+ def getElementsByTagNameNS(self, namespaceURI, localName):
+ return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
def writexml(self, writer, indent="", addindent="", newl=""):
writer.write('<?xml version="1.0" ?>\n')