At most one subdivision in the shipping party address

Error FX-SCH-A-000804 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. The element may occur no more than once.

What the rule means

The rule limits the number of subdivision names in the postal address to one. Multiple such elements are not allowed by this XML structure.

Please remove duplicate subdivision names from the shipping party address

The shipping party’s postal address contains ram:CountrySubDivisionName more than once. This element may occur at most once in the address.

What to do
  1. Check ram:PostalTradeAddress of ram:ShipFromTradeParty.
  2. Remove the 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/>
  <ram:CountrySubDivisionName/>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName/>
</ram:PostalTradeAddress>
Technical details

The check counts direct ram:CountrySubDivisionName elements inside ram:PostalTradeAddress and requires a count no greater than 1.

Where the rule applies

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

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