...
 
Commits (2)
......@@ -307,7 +307,7 @@ def load_structure_xml_file(ds_code, structure_file: Path):
if in_codelist:
# Code id
# Code id (dimension value)
if elt.tag == CODE_TAG:
if evt == 'start':
current_code = elt.attrib.get('value')
......@@ -316,16 +316,18 @@ def load_structure_xml_file(ds_code, structure_file: Path):
current_codelist['values'][current_code] = code_name
in_code = (evt == 'start')
# Name
# Name (dimension label)
if elt.tag == NAME_TAG:
# Code name
if not in_code:
# Code list name
if evt == 'start':
current_codelist_name_dict[elt.attrib.get(LANG_ATT)] = norm_space(elt.text)
# Description (dimension value label)
if elt.tag == DESCRIPTION_TAG:
if in_code:
if evt == 'start':
current_code_name_dict[elt.attrib.get(LANG_ATT)] = norm_space(elt.text)
# Code list name
else:
if evt == 'start':
current_codelist_name_dict[elt.attrib.get(LANG_ATT)] = norm_space(elt.text)
# Use conceptRef as code for dimensions instead of codelist id which can have duplicate...
codelists = [{'id': concept, 'name': cl['name'], 'values':cl['values']} for concept, cl in zip(concepts, codelists)]
......