Invalid country identifier code in the payee legal organization’s address

Error FX-SCH-A-001000 Factur-X

Value of 'ram:CountryID' is not allowed.

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

A non-empty value in ram:CountryID is not included in the code list specified for this element. An empty value passes this value check, but the number of elements is checked separately.

What the rule means

The country identifier assigns the address to a country. An allowed code is required so that this country value can be interpreted using the specified code list.

Please use an allowed country code in the payee legal organization’s address

The value of ram:CountryID in the payee legal organization’s address is not included in the allowed code list. Use a code listed there as the content of this element.

What to do
  1. Check the content of ram:CountryID in ram:PostalTradeAddress.
  2. Compare the non-empty value with the code list applicable to this element.
  3. Generate the invoice again and validate it once more.
Technical details

The test accepts an empty value or a value from the code list with identifier 10. It checks the content of ram:CountryID; the element count is checked by a separate rule.

Where the rule applies

The rule applies to ram:CountryID in the payee legal organization’s ram:PostalTradeAddress in the payment terms.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradePaymentTerms/ram:PayeeTradeParty/ram:SpecifiedLegalOrganization/ ram:PostalTradeAddress/ram:CountryID
Test expression (assert/@test)
string-length($codeValue10)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=10]/enumeration[@value=$codeValue10]