From 7e05ada7ed6b8d0c39f53546c9723a68a7a2e810 Mon Sep 17 00:00:00 2001 From: Dragos0000 Date: Mon, 25 Apr 2022 16:53:51 +0100 Subject: [PATCH] form number xpath and notices without namespaces --- .../services/xml_manifestation_metadata_extractor.py | 2 +- ted_sws/metadata_normaliser/services/xpath_registry.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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):