Mercurial > hg > drupalISMI
comparison importFromOpenMind/importer/ismixml2model.py @ 54:b9a6e596ebe4
fix transfer of ownvalue to _label attribute.
author | casties |
---|---|
date | Fri, 21 Apr 2017 19:04:09 +0200 |
parents | 5a633e875490 |
children | 5a1a4af235eb |
comparison
equal
deleted
inserted
replaced
53:1f160e595167 | 54:b9a6e596ebe4 |
---|---|
91 | 91 |
92 attrs = {} | 92 attrs = {} |
93 | 93 |
94 # get attributes element | 94 # get attributes element |
95 atts_elem = ent_elem.find('attributes') | 95 atts_elem = ent_elem.find('attributes') |
96 | |
97 # more text content of entity element | |
98 ov += atts_elem.tail or '' | |
96 | 99 |
97 if atts_elem is None: | 100 if atts_elem is None: |
98 log('DEBUG', "entity has no attributes: %s"%ent_elem) | 101 log('DEBUG', "entity has no attributes: %s"%ent_elem) |
99 | 102 |
100 else: | 103 else: |
160 # rename id to ismi_id | 163 # rename id to ismi_id |
161 attrs['ismi_id'] = ismi_id | 164 attrs['ismi_id'] = ismi_id |
162 | 165 |
163 if len(ov) > 0: | 166 if len(ov) > 0: |
164 # save ov as label | 167 # save ov as label |
165 attrs['label'] = ov | 168 attrs['_label'] = ov |
166 # check for normalized value | 169 # check for normalized value |
167 nov = ent_elem.findtext('norm') | 170 nov = ent_elem.findtext('norm') |
168 if nov is not None: | 171 if nov is not None: |
169 # add normalized value | 172 # add normalized value |
170 attrs['_n_label'] = nov | 173 attrs['_n_label'] = nov |