From 4a9cf433d1ac293dc396ae05cffcefd9e85ce3d0 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 16 Jul 2025 17:47:33 +1000 Subject: [PATCH] Fix bug in IfcTester thanks to Sayan where parsing XML text using ET would expand namespaces and therefore break namespaces during decode --- src/ifctester/ifctester/ids.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ifctester/ifctester/ids.py b/src/ifctester/ifctester/ids.py index 7e02151a23..e2a57ce7f8 100644 --- a/src/ifctester/ifctester/ids.py +++ b/src/ifctester/ifctester/ids.py @@ -63,12 +63,11 @@ def open(filepath: str, validate: bool = False) -> Ids: def from_string(xml: str, validate: bool = False) -> Ids: - tree = ET.ElementTree(ET.fromstring(xml)) try: if validate: get_schema().validate(tree) decode = get_schema().decode( - tree, strip_namespaces=True, namespaces={"": "http://standards.buildingsmart.org/IDS"} + xml, strip_namespaces=True, namespaces={"": "http://standards.buildingsmart.org/IDS"} ) except XMLSchemaValidationError as e: raise IdsXmlValidationError(e, "Provided XML appears to be invalid. See details above.")