Fix getElementsByTagNameNS:

- actually return a result
  - Compare with tag.localName in getElementsByTagNameNSHelper
This commit is contained in:
Martin v. Löwis 2001-06-03 14:06:42 +00:00
parent 453163d842
commit ed525fb0df
1 changed files with 7 additions and 3 deletions

View File

@ -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 = []