mirror of https://github.com/python/cpython.git
Fix getElementsByTagNameNS:
- actually return a result - Compare with tag.localName in getElementsByTagNameNSHelper
This commit is contained in:
parent
453163d842
commit
ed525fb0df
|
@ -279,7 +279,7 @@ def _getElementsByTagNameHelper(parent, name, rc):
|
|||
def _getElementsByTagNameNSHelper(parent, nsURI, localName, rc):
|
||||
for node in parent.childNodes:
|
||||
if node.nodeType == Node.ELEMENT_NODE:
|
||||
if ((localName == "*" or node.tagName == localName) and
|
||||
if ((localName == "*" or node.localName == localName) and
|
||||
(nsURI == "*" or node.namespaceURI == nsURI)):
|
||||
rc.append(node)
|
||||
_getElementsByTagNameNSHelper(node, nsURI, localName, rc)
|
||||
|
@ -551,7 +551,9 @@ def getElementsByTagName(self, name):
|
|||
return _getElementsByTagNameHelper(self, name, [])
|
||||
|
||||
def getElementsByTagNameNS(self, namespaceURI, localName):
|
||||
_getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
|
||||
rc = []
|
||||
_getElementsByTagNameNSHelper(self, namespaceURI, localName, rc)
|
||||
return rc
|
||||
|
||||
def __repr__(self):
|
||||
return "<DOM Element: %s at %s>" % (self.tagName, id(self))
|
||||
|
@ -880,7 +882,9 @@ def createAttributeNS(self, namespaceURI, qualifiedName):
|
|||
return a
|
||||
|
||||
def getElementsByTagNameNS(self, namespaceURI, localName):
|
||||
_getElementsByTagNameNSHelper(self, namespaceURI, localName)
|
||||
rc = []
|
||||
_getElementsByTagNameNSHelper(self, namespaceURI, localName, rc)
|
||||
return rc
|
||||
|
||||
def getElementsByTagName(self, name):
|
||||
rc = []
|
||||
|
|
Loading…
Reference in New Issue