Address country identifier is missing or repeated

Error FX-SCH-A-000896 Factur-X

Element 'ram:CountryID' must occur exactly 1 times.

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

ram:CountryID does not occur exactly once in ram:PostalTradeAddress. The element is either missing or repeated.

What the rule means

The country identifier specifies the country of the invoicer’s postal address. Exactly one such element is required for the address to be structurally unambiguous.

Please include the address country identifier exactly once

The invoicer’s postal address does not contain ram:CountryID exactly once. You can adjust the address structure accordingly.

What to do
  1. Locate ram:PostalTradeAddress in the invoicer’s address.
  2. Make sure it contains exactly one ram:CountryID.
  3. Generate the invoice again and validate it once more.
Technical details

The test counts the direct ram:CountryID elements in ram:PostalTradeAddress and requires the count to be 1.

Where the rule applies

The rule applies to the invoicer’s postal address in ram:InvoicerTradeParty, within ram:PostalTradeAddress.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:InvoicerTradeParty/ram:PostalTradeAddress
Test expression (assert/@test)
count(ram:CountryID)=1