Use a scheme identifier from the ISO 6523 ICD list

Error BR-DEX-05 XRechnung

Any scheme identifier in <name/> MUST be coded using one of the ISO 6523 ICD list.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The schemeID of an affected ID element is not in the ISO 6523 ICD extension list or contains whitespace. The value must be a single identifier included in that list.

What the rule means

The ISO 6523 ICD list defines codes for identification schemes. A code from this list allows the identifier scheme to be identified unambiguously.

Please use a scheme identifier from the ISO 6523 ICD list for `ID`

For an ID element, schemeID is not a valid single identifier from the ISO 6523 ICD list. Replace it with an identifier included in that list and containing no spaces.

What to do
  1. Find the affected ID element and note the value of schemeID.
  2. Replace the value with an identifier from the ISO 6523 ICD list that contains no spaces.
  3. Generate the invoice again and validate it once more.
Technical details

The test normalizes @schemeID, requires it to contain no spaces, and checks membership in $ISO-6523-ICD-EXT-CODES. ID elements inside SpecifiedTaxRegistration are excluded.

Where the rule applies

The rule applies to ID elements with schemeID in the extension context, unless they belong to SpecifiedTaxRegistration.

Context (rule/@context)
ram:ID[@schemeID and $isExtension][not(ancestor::ram:SpecifiedTaxRegistration)]
Test expression (assert/@test)
(( not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' ')) ))