Include the region in the ship-to address at most once

Error FX-SCH-A-001099 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 appear there at most once.

What the rule means

The rule limits the region or subdivision of the country in the postal address to at most one element.

Please include the region in the ship-to address at most once

ram:CountrySubDivisionName appears more than once in the ship-to party’s postal address. Remove the duplicate; the region may also be omitted.

What to do
  1. Find ram:PostalTradeAddress for the ship-to party in the invoice line.
  2. Remove any extra ram:CountrySubDivisionName elements so that at most one remains.
  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 check counts the direct ram:CountrySubDivisionName elements in ram:PostalTradeAddress and allows zero or one.

Where the rule applies

This rule applies to the ship-to party’s postal address within an invoice line.

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