ElementTree's iter() equivalent in Python2.6 ElementTree's iter() equivalent in Python2.6 xml xml

ElementTree's iter() equivalent in Python2.6


Not sure if this is what you are looking for, as iter() appears to be around in 2.6, but there's getiterator()

http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator


Note that iter is available in Python 2.6 (and even 2.5 - otherwise, there'd be a notice in the docs), so you don't really need a replacement.

You can, however, use findall:

def _iter_python26(node):  return [node] + node.findall('.//*')