def testOldFashionedAttr(self): result = [] expected = ["1", "2", "3"] root = HelperXml.getNodeElement( self.dom, "root") for rootChild in root.childNodes: if rootChild.nodeName == "node": result.append(HelperXml.getNodeAttribute( rootChild, "attr" )) self.assertEqual( result, expected )
def testOldFashionedNode(self): result = [] expected = ["FOO", "BAR"] elem = HelperXml.getNodeElement( self.dom, "root", "blap") for blapChild in elem.childNodes: if blapChild.nodeName == "subnode": for subnodeChild in blapChild.childNodes: if subnodeChild.nodeName == "name": result.append(HelperXml.getNodeText( subnodeChild )) self.assertEqual( result, expected )