From 339e2eaadacf1491c12a84931a7bc3574e729e80 Mon Sep 17 00:00:00 2001 From: Manuel Schmidt Date: Mon, 26 Feb 2024 21:12:35 +0100 Subject: [PATCH] Fixed #126 --- xbrl/instance.py | 4 ++-- xbrl/taxonomy.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xbrl/instance.py b/xbrl/instance.py index 3b1fba4..d88d67c 100644 --- a/xbrl/instance.py +++ b/xbrl/instance.py @@ -368,7 +368,8 @@ def parse_xbrl(instance_path: str, cache: HttpCache, instance_url: str or None = facts: List[AbstractFact] = [] for fact_elem in root: # skip contexts and units - if 'context' in fact_elem.tag or 'unit' in fact_elem.tag or 'schemaRef' in fact_elem.tag: + taxonomy_ns, concept_name = fact_elem.tag.split('}') + if 'context' in concept_name or 'unit' in concept_name or 'schemaRef' in concept_name: continue # check if the element has the required attributes if 'contextRef' not in fact_elem.attrib: @@ -381,7 +382,6 @@ def parse_xbrl(instance_path: str, cache: HttpCache, instance_url: str or None = xml_id: str or None = fact_elem.attrib['id'] if 'id' in fact_elem.attrib else None # find the taxonomy where the tag is coming from - taxonomy_ns, concept_name = fact_elem.tag.split('}') taxonomy_ns = taxonomy_ns.replace('{', '') # get the concept object from the taxonomy tax = taxonomy.get_taxonomy(taxonomy_ns) diff --git a/xbrl/taxonomy.py b/xbrl/taxonomy.py index b970c61..4150139 100644 --- a/xbrl/taxonomy.py +++ b/xbrl/taxonomy.py @@ -446,7 +446,9 @@ 'http://xbrl.sec.gov/rr-lab/2022': 'https://xbrl.sec.gov/rr/2022/rr-2022_lab.xsd', 'http://xbrl.sec.gov/rr-pre/2022': 'https://xbrl.sec.gov/rr/2022/rr-2022_pre.xsd', 'http://xbrl.sec.gov/rr-def/2022': 'https://xbrl.sec.gov/rr/2022/rr-2022_def.xsd', - 'http://www.xbrl.org/dtr/type/2022-03-31': 'https://www.xbrl.org/dtr/type/2022-03-31/types.xsd' + 'http://www.xbrl.org/dtr/type/2022-03-31': 'https://www.xbrl.org/dtr/type/2022-03-31/types.xsd', + + 'http://www.hmrc.gov.uk/schemas/ct/dpl/2021-01-01': 'https://www.hmrc.gov.uk/schemas/ct/dpl/2021-01-01/dpl-2021.xsd' }