Skip to content

XBRL typed dimension crashes conversion at memberQname.localName #4437

Description

@noho

Bug

A valid XBRL instance with a typed dimension fails conversion in Docling. Both Path and DocumentStream inputs fail at docling/backend/xml/xbrl_backend.py:344 because dim_value.memberQname is None for a typed member. The same dereference remains on main as of 2026-09-29.

Versions and validation

  • Python 3.11.15, macOS arm64
  • docling==2.127.0, docling-core==2.96.0, docling-slim==2.127.0
  • arelle-release==2.45.3
  • python -m arelle.CntlrCmdLine --file typed.xml --validate --internetConnectivity offline --validationExitCode --logLevel INFO exits 0 and reports validated without validation errors for the two synthetic files below.

Minimal reproducer

Place these two files in one directory. All names and values are synthetic.

typed.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xmlns:t="https://example.invalid/o20/typed" targetNamespace="https://example.invalid/o20/typed" elementFormDefault="qualified">
  <xs:import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
  <xs:element name="Revenue" id="t_Revenue" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration"/>
  <xs:element name="RegionAxis" id="t_RegionAxis" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" xbrldt:typedDomainRef="typed.xsd#t_RegionDomain"/>
  <xs:element name="RegionDomain" id="t_RegionDomain" type="xs:string"/>
</xs:schema>

typed.xml:

<?xml version="1.0" encoding="UTF-8"?>
<xbrli:xbrl xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:xbrldi="http://xbrl.org/2006/xbrldi" xmlns:t="https://example.invalid/o20/typed">
<link:schemaRef xlink:type="simple" xlink:href="typed.xsd"/>
<xbrli:context id="c1"><xbrli:entity><xbrli:identifier scheme="https://example.invalid/entity">Entity</xbrli:identifier><xbrli:segment><xbrldi:typedMember dimension="t:RegionAxis"><t:RegionDomain>North</t:RegionDomain></xbrldi:typedMember></xbrli:segment></xbrli:entity><xbrli:period><xbrli:startDate>2024-01-01</xbrli:startDate><xbrli:endDate>2024-12-31</xbrli:endDate></xbrli:period></xbrli:context>
<xbrli:unit id="u1"><xbrli:measure>iso4217:USD</xbrli:measure></xbrli:unit>
<t:Revenue contextRef="c1" unitRef="u1" decimals="0">123</t:Revenue>
</xbrli:xbrl>

Run from that directory:

from io import BytesIO
from pathlib import Path

from docling.datamodel.base_models import DocumentStream, InputFormat
from docling.datamodel.backend_options import XBRLBackendOptions
from docling.document_converter import DocumentConverter, XBRLFormatOption

root = Path.cwd()
converter = DocumentConverter(
    allowed_formats=[InputFormat.XML_XBRL],
    format_options={
        InputFormat.XML_XBRL: XBRLFormatOption(
            backend_options=XBRLBackendOptions(
                taxonomy=root,
                enable_local_fetch=True,
                enable_remote_fetch=False,
            )
        )
    },
)
for source in (
    root / "typed.xml",
    DocumentStream(name="typed.xml", stream=BytesIO((root / "typed.xml").read_bytes())),
):
    print(converter.convert(source).document.export_to_markdown())

Actual / expected

For both inputs, converter.convert raises RuntimeError("Pipeline SimplePipeline failed"), caused by AttributeError("'NoneType' object has no attribute 'localName'") at xbrl_backend.py:344:

f"{dim_qname.localName}: {dim_value.memberQname.localName}"

Arelle's ModelDimensionValue.memberQname is intentionally None for typed dimensions; the typed value is represented separately. Expected: conversion should retain the typed dimension value without this exception. This report concerns the typed dimension branch only; an invalid explicit member caused by missing taxonomy may reach the same line for a different reason.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions