diff --git a/ted_sws/metadata_normaliser/services/xml_manifestation_metadata_extractor.py b/ted_sws/metadata_normaliser/services/xml_manifestation_metadata_extractor.py index 69001d0de..918525a42 100644 --- a/ted_sws/metadata_normaliser/services/xml_manifestation_metadata_extractor.py +++ b/ted_sws/metadata_normaliser/services/xml_manifestation_metadata_extractor.py @@ -263,7 +263,7 @@ def _get_normalised_namespaces(self): namespaces = dict([node for _, node in ET.iterparse(source=StringIO(self.xml_manifestation.object_data), events=['start-ns'])]) - namespaces["manifestation_ns"] = namespaces.pop("") + namespaces["manifestation_ns"] = namespaces.pop("") if "" in namespaces.keys() else "" tmp_dict = namespaces.copy() items = tmp_dict.items() diff --git a/ted_sws/metadata_normaliser/services/xpath_registry.py b/ted_sws/metadata_normaliser/services/xpath_registry.py index 832522e26..aff6c7dea 100644 --- a/ted_sws/metadata_normaliser/services/xpath_registry.py +++ b/ted_sws/metadata_normaliser/services/xpath_registry.py @@ -117,7 +117,7 @@ def xpath_legal_basis_directive_third(self): @property def xpath_form_number(self): - return "manifestation_ns:FORM_SECTION/*[1]" + return ".//*[@FORM]" @property def xpath_notice_type(self):