The country subdivision may occur only once

Error FX-SCH-A-001118 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

PostalTradeAddress contains more than one CountrySubDivisionName element. This element may occur no more than once.

What the rule means

CountrySubDivisionName contains the name of a country subdivision in the postal address. Multiple occurrences would repeat this information within the same address.

Please use no more than one country subdivision in the ultimate delivery address

The country subdivision is entered more than once in the ultimate ship-to party’s postal address. There may be no more than one CountrySubDivisionName.

What to do
  1. Open the ultimate ship-to party’s PostalTradeAddress.
  2. Remove duplicate CountrySubDivisionName elements so that no more than one remains.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>A</ram:CountrySubDivisionName>
  <ram:CountrySubDivisionName>B</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>A</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
Technical details

The test counts the direct ram:CountrySubDivisionName elements in ram:PostalTradeAddress and permits at most one.

Where the rule applies

The rule applies to the postal address of the ultimate ship-to party for an invoice line, under UltimateShipToTradeParty.

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