Next / Previous / Contents / TCC Help System / NM Tech homepage

9.18. Element.keys(): Find all attribute names

For any Element instance E, this method returns a list of the element's XML attribute names, in no particular order.

E.keys()

Here's an example:

>>> node = etree.fromstring("<event time='1830' cost='3.50' rating='nc-03'/>")
>>> node.keys()
['time', 'rating', 'cost']
>>>