At most one subdivision for the legal organization

Error FX-SCH-A-000846 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 PostalTradeAddress. The element may appear no more than once in this address.

What the rule means

ram:CountrySubDivisionName identifies a subdivision within the country. Multiple occurrences of this element are not permitted here.

Please provide no more than one subdivision for the legal organization

ram:CountrySubDivisionName is entered more than once in the legal organization’s postal address. You can resolve this by limiting it to no more than one element.

What to do
  1. Locate PostalTradeAddress under SpecifiedLegalOrganization for the ultimate ship-to party.
  2. Remove any extra ram:CountrySubDivisionName elements so that no more than one remains.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Nord</ram:CountrySubDivisionName>
  <ram:CountrySubDivisionName>Sud</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Nord</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
Technical details

The test counts the direct ram:CountrySubDivisionName elements in PostalTradeAddress and requires a count of no more than 1.

Where the rule applies

The rule applies to PostalTradeAddress of the SpecifiedLegalOrganization for the ultimate ship-to party.

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