Provide the address country exactly once

Error FX-SCH-A-000718 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

In ram:PostalTradeAddress, ram:CountryID does not occur exactly once. The element is missing or appears more than once.

What the rule means

A postal address requires exactly one country identifier so that its country is unambiguous.

Please provide the end-user address country exactly once

The end user’s postal address is missing its country or lists it more than once. Providing it exactly once makes the address unambiguously associated with a country.

What to do
  1. Check ram:PostalTradeAddress for ram:CountryID.
  2. Make sure it contains exactly one ram:CountryID element.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID/>
</ram:PostalTradeAddress>
Technical details

The check counts the direct ram:CountryID elements within ram:PostalTradeAddress and requires exactly one.

Where the rule applies

The rule applies to the postal address of ram:ProductEndUserTradeParty in the invoice agreement.

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