At most one subdivision in the ship-from organization address

Error FX-SCH-A-000808 Factur-X

Element 'ram:CountrySubDivisionName' may occur at maximum 1 times.

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

ram:CountrySubDivisionName occurs more than once in ram:PostalTradeAddress.

What the rule means

The address may contain at most one subdivision entry. Multiple occurrences of this element do not conform to the specified structure.

Please include at most one subdivision in the ship-from organization address

ram:CountrySubDivisionName appears more than once in the ship-from organization’s address. You can reduce the repeated entries to at most one element.

What to do
  1. Locate ram:PostalTradeAddress in ram:SpecifiedLegalOrganization for the ship-from party.
  2. Check how many times ram:CountrySubDivisionName occurs in it.
  3. Remove any extra occurrences so that no more than one remains.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Nord</ram:CountrySubDivisionName>
  <ram:CountrySubDivisionName>Est</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Nord</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
Technical details

The rule checks whether the number of direct ram:CountrySubDivisionName child elements of ram:PostalTradeAddress is less than or equal to one.

Where the rule applies

This rule applies to ram:PostalTradeAddress within ram:SpecifiedLegalOrganization for the ship-from party (ram:ShipFromTradeParty).

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