FAILURE MAP
← Case archive

FA-4001 / Markup / Open access

Default element namespaces are incorrectly applied to attributes · case 01

Default element namespaces are incorrectly applied to attributes.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Return the unqualified id attribute; prefixed attributes do not satisfy it.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Return the unqualified id attribute; prefixed attributes do not satisfy it.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Return the unqualified id attribute; prefixed attributes do not satisfy it.

Why this case matters

A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return next(iter(ET.fromstring(x).attrib.values()),None)
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('<r xmlns="u" id="x"/>'), 'x')
check('boundary 2', solve('<r xmlns:p="u" p:id="x"/>'), None)
check('boundary 3', solve('<r name="n"/>'), None)
check('boundary 4', solve('<r/>'), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1xxPassed
boundary 2xNoneFailed
boundary 3nNoneFailed
boundary 4NoneNonePassed

SHA-256 / 77137be45d864e546ea41a03a90178917f14d563944dcef46a585825814369c9

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return next((v for k,v in ET.fromstring(x).attrib.items() if k.rsplit('}',1)[-1]=='id'),None)
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('<r xmlns="u" id="x"/>'), 'x')
check('boundary 2', solve('<r xmlns:p="u" p:id="x"/>'), None)
check('boundary 3', solve('<r name="n"/>'), None)
check('boundary 4', solve('<r/>'), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1xxPassed
boundary 2xNoneFailed
boundary 3NoneNonePassed
boundary 4NoneNonePassed

SHA-256 / f94da78664f99171cbd244a3e3d6f8fb613434169364625bda0d32eab6364d9a

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return ET.fromstring(x).get('id')
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('<r xmlns="u" id="x"/>'), 'x')
check('boundary 2', solve('<r xmlns:p="u" p:id="x"/>'), None)
check('boundary 3', solve('<r name="n"/>'), None)
check('boundary 4', solve('<r/>'), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1xxPassed
boundary 2NoneNonePassed
boundary 3NoneNonePassed
boundary 4NoneNonePassed

SHA-256 / 59076d31e58d6185e13efb79299de56dfdc6283487c3e8df69198f14bae0fc32

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:34.322358+00:00.

Case digest / d714617fb883305e5ac33333f3b756feeb3764febe1febabbea18f6a7631c667