At most one subdivision for the ultimate ship-to address

Error FX-SCH-A-000842 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 ultimate ship-to address

ram:CountrySubDivisionName is entered more than once in the ultimate ship-to postal address. You can resolve this by limiting it to no more than one element.

What to do
  1. Locate PostalTradeAddress under UltimateShipToTradeParty.
  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 for the ultimate ship-to party under UltimateShipToTradeParty.

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