Address subdivision may occur at most once

Error FX-SCH-A-000897 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 rule allows at most one such element.

What the rule means

ram:CountrySubDivisionName contains the name of a subdivision of the country in the address. Limiting it to one element avoids ambiguous or repeated entries in this location.

Please include the address subdivision no more than once

The invoicer’s postal address contains ram:CountrySubDivisionName more than once. Remove the duplicate entry from the structure.

What to do
  1. Locate ram:PostalTradeAddress in the invoicer’s address.
  2. Check whether ram:CountrySubDivisionName occurs more than once.
  3. Keep no more than one ram:CountrySubDivisionName in the address.
  4. Generate the invoice again and validate it once more.
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 test counts the direct ram:CountrySubDivisionName elements in ram:PostalTradeAddress and allows at most one.

Where the rule applies

The rule applies to the invoicer’s postal address in ram:InvoicerTradeParty, within ram:PostalTradeAddress.

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