From ed525fb0dfa45595e8e93cbde3d5b05838bf993a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 3 Jun 2001 14:06:42 +0000 Subject: [PATCH] Fix getElementsByTagNameNS: - actually return a result - Compare with tag.localName in getElementsByTagNameNSHelper --- Lib/xml/dom/minidom.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 97d622f36f4..59f86a75e73 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -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 "" % (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 = []