Value of ram:TypeCode is not allowed

Error FX-SCH-A-000023 Factur-X

Value of 'ram:TypeCode' is not allowed.

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

The non-empty value of ram:TypeCode does not match an entry in the code list checked for this element. An empty value passes this XPath test and is not reported as an invalid value by this rule.

What the rule means

ram:TypeCode identifies the document type. A provided code must be included in the corresponding code list.

Please use an allowed code for the document type

The value provided for ram:TypeCode is not included in the code list checked for it. Select a code listed there.

What to do
  1. Replace the disallowed value of ram:TypeCode with a code from the corresponding code list.
  2. Generate the invoice again and validate it once more.
Technical details

The XPath test passes when $codeValue2 is empty or when its value appears in the enumeration of code list ID 2 in FACTUR-X_MINIMUM_codedb.xml.

Where the rule applies

The rule applies to ram:TypeCode in the document header, rsm:ExchangedDocument.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode
Test expression (assert/@test)
string-length($codeValue2)=0 or document('FACTUR-X_MINIMUM_codedb.xml')/codedb/cl[@id=2]/enumeration[@value=$codeValue2]