{
  "schema": 1,
  "sqlstate": "2200M",
  "condition_name": "invalid_xml_document",
  "sources": [
    {
      "id": "src.errcodes.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L211",
      "lines": "211"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.xml-invalid-document",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/xml.c",
      "sha256": "f1c70b5ee5ee9a20a41d9b2c27bc7a8a50dbd47d9489ba462a4a678f7f55f14d",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/xml.c#L1846-L1862",
      "lines": "1846-1862"
    },
    {
      "id": "src.path.xml2-document",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "contrib/xml2/xslt_proc.c",
      "sha256": "a5a76f59e851175955dfa62477fd4a7d7be3fb69b37e7a7e955ab76c8e01d0ae",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/xml2/xslt_proc.c#L84-L100",
      "lines": "84-100"
    },
    {
      "id": "src.path.xml-error-save",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/xml.c",
      "sha256": "f1c70b5ee5ee9a20a41d9b2c27bc7a8a50dbd47d9489ba462a4a678f7f55f14d",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/xml.c#L2047-L2082",
      "lines": "2047-2082"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "2200M is invalid_xml_document in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "mechanism.core-xml",
      "statement": "The core xml_parse document branch maps a failed libxml document parse to 2200M with primary invalid XML document.",
      "sources": [
        "src.path.xml-invalid-document"
      ],
      "method": "Read the document parse failure branch.",
      "limits": "The dynamic libxml diagnostic may be attached separately; no single static DETAIL template should be invented."
    },
    {
      "id": "mechanism.error-save",
      "statement": "The core xml_errsave helper passes XML errors to errsave: an ErrorSaveContext stores the error and returns, while an ordinary context throws; this soft-error path is distinct from the direct ERROR branches in contrib/xml2.",
      "method": "Read the xml_errsave comment and errsave call.",
      "limits": "This source distinction describes error propagation; it is not a natural runtime observation."
    },
    {
      "id": "mechanism.xml2",
      "statement": "The contrib/xml2 XSLT path also reports invalid XML document when its parser reports an error.",
      "sources": [
        "src.path.xml2-document"
      ],
      "method": "Read the complete xml2 error branch.",
      "limits": "This path requires the xml2 extension and is separate from core XML constructors."
    },
    {
      "id": "build-boundary",
      "statement": "Core XML branches are compiled under the USE_LIBXML feature guard; availability depends on the server build.",
      "sources": [
        "src.path.xml-invalid-document"
      ],
      "method": "Read surrounding fixed source guards.",
      "limits": "Source confirmation is not a natural runtime observation."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 2200M from 8.3.0 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.core-document",
      "sqlstate": "2200M",
      "primary_template": "invalid XML document",
      "severity_source": "ERROR",
      "sources": [
        "src.path.xml-invalid-document"
      ]
    },
    {
      "id": "message.xml2-document",
      "sqlstate": "2200M",
      "primary_template": "error parsing XML document",
      "severity_source": "ERROR",
      "sources": [
        "src.path.xml2-document"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.core-xml",
        "mechanism.xml2",
        "mechanism.error-save"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "mechanism.core-xml"
      ]
    }
  ],
  "runtime": []
}
