From bb5cfddd2e7fee531574c97058c2bac91cf44891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Otto?= Date: Wed, 7 Sep 2022 10:24:32 +0200 Subject: [PATCH] Fixed xml deserialization for missing prefixes --- basyx/aas/adapter/xml/xml_deserialization.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basyx/aas/adapter/xml/xml_deserialization.py b/basyx/aas/adapter/xml/xml_deserialization.py index 4ca7bc294..551bde750 100644 --- a/basyx/aas/adapter/xml/xml_deserialization.py +++ b/basyx/aas/adapter/xml/xml_deserialization.py @@ -85,8 +85,9 @@ def _tag_replace_namespace(tag: str, nsmap: Dict[str, str]) -> str: """ split = tag.split("}") for prefix, namespace in nsmap.items(): - if namespace == split[0][1:]: - return prefix + ":" + split[1] + if prefix: + if namespace == split[0][1:]: + return prefix + ":" + split[1] return tag