Get the name associated with an element, either a name child or name attribute.
(elem, default=None)
| 6 | |
| 7 | |
| 8 | def getElemName(elem, default=None): |
| 9 | """Get the name associated with an element, either a name child or name attribute.""" |
| 10 | name_elem = elem.find('name') |
| 11 | if name_elem is not None: |
| 12 | return name_elem.text |
| 13 | # Fallback if there is no child. |
| 14 | return elem.get('name', default) |
| 15 | |
| 16 | |
| 17 | def getElemType(elem, default=None): |
no test coverage detected