Country in the legal organization address

Error FX-SCH-A-000807 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 is missing from ram:PostalTradeAddress or occurs more than once. It must occur exactly once.

What the rule means

ram:CountryID identifies the country of the legal organization’s postal address. Exactly one country element is required so the address specifies one country unambiguously.

Please include the legal organization’s country exactly once

The legal organization’s postal address does not contain exactly one ram:CountryID. Add the missing element or remove a duplicate.

What to do
  1. Check ram:PostalTradeAddress in ram:SpecifiedLegalOrganization.
  2. Make sure ram:CountryID occurs exactly once in it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID/>
</ram:PostalTradeAddress>
Technical details

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

Where the rule applies

The rule applies to ram:PostalTradeAddress in ram:SpecifiedLegalOrganization of ram:ShipFromTradeParty.

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