Commit fbe7b4fc authored by Fred Drake's avatar Fred Drake

Make the implementations of getElementsByTagName() and

getElementsByTagNameNS() consistent in form as well as functionality
(cosmetic).
parent ec3dfdee
...@@ -551,9 +551,7 @@ class Element(Node): ...@@ -551,9 +551,7 @@ class Element(Node):
return _getElementsByTagNameHelper(self, name, []) return _getElementsByTagNameHelper(self, name, [])
def getElementsByTagNameNS(self, namespaceURI, localName): def getElementsByTagNameNS(self, namespaceURI, localName):
rc = [] return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
_getElementsByTagNameNSHelper(self, namespaceURI, localName, rc)
return rc
def __repr__(self): def __repr__(self):
return "<DOM Element: %s at %s>" % (self.tagName, id(self)) return "<DOM Element: %s at %s>" % (self.tagName, id(self))
...@@ -881,15 +879,11 @@ class Document(Node): ...@@ -881,15 +879,11 @@ class Document(Node):
a.value = "" a.value = ""
return a return a
def getElementsByTagNameNS(self, namespaceURI, localName):
rc = []
_getElementsByTagNameNSHelper(self, namespaceURI, localName, rc)
return rc
def getElementsByTagName(self, name): def getElementsByTagName(self, name):
rc = [] return _getElementsByTagNameHelper(self, name, [])
_getElementsByTagNameHelper(self, name, rc)
return rc def getElementsByTagNameNS(self, namespaceURI, localName):
return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
def writexml(self, writer, indent="", addindent="", newl=""): def writexml(self, writer, indent="", addindent="", newl=""):
writer.write('<?xml version="1.0" ?>\n') writer.write('<?xml version="1.0" ?>\n')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment