Provide the legal organization address country exactly once

Error FX-SCH-A-000722 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 the relevant 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 legal organization address country exactly once

The postal address for the legal organization 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 the postal address in ram:SpecifiedLegalOrganization 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 the postal address of ram:SpecifiedLegalOrganization and requires exactly one.

Where the rule applies

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

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