The delivery address may contain at most one country subdivision

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

ram:PostalTradeAddress contains more than one ram:CountrySubDivisionName.

What the rule means

ram:CountrySubDivisionName specifies a country subdivision within the postal address. The rule allows no more than one such value.

Please include no more than one country subdivision in the delivery address

The postal address of the ultimate ship-to party contains multiple ram:CountrySubDivisionName elements. The rule allows at most one.

What to do
  1. Locate the ram:PostalTradeAddress of the ultimate ship-to party.
  2. Check whether it contains more than one ram:CountrySubDivisionName.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Region A</ram:CountrySubDivisionName>
  <ram:CountrySubDivisionName>Region B</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>Region A</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
Technical details

The test counts the direct ram:CountrySubDivisionName child elements of ram:PostalTradeAddress and requires the count to be less than or equal to 1.

Where the rule applies

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

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