Get the unique child element under xtag with name eltname
(xtag, eltname)
| 119 | # XML processing utility functions that are useful for the particular |
| 120 | # structure of the phone number metadata |
| 121 | def _get_unique_child(xtag, eltname): |
| 122 | """Get the unique child element under xtag with name eltname""" |
| 123 | try: |
| 124 | results = xtag.findall(eltname) |
| 125 | if len(results) > 1: |
| 126 | raise Exception("Multiple elements found where 0/1 expected") |
| 127 | elif len(results) == 1: |
| 128 | return results[0] |
| 129 | else: |
| 130 | return None |
| 131 | except Exception: |
| 132 | return None |
| 133 | |
| 134 | |
| 135 | def _get_unique_child_value(xtag, eltname): |
no outgoing calls
no test coverage detected