At most one subdivision in the legal organization's address

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

The legal organization's ram:PostalTradeAddress contains ram:CountrySubDivisionName more than once.

What the rule means

The rule limits the subdivision entry in the postal address to no more than one element. It may be absent, but must not be repeated.

Please use no more than one subdivision in the legal organization's address

The legal organization's postal address for the payer contains ram:CountrySubDivisionName more than once. This element can occur no more than once in the address.

What to do
  1. Open ram:PostalTradeAddress in the payer's ram:SpecifiedLegalOrganization.
  2. Remove duplicate entries so that ram:CountrySubDivisionName occurs no more than once.
  3. 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 child elements named ram:CountrySubDivisionName and accepts a count of at most 1.

Where the rule applies

The rule applies to the optional subdivision entry ram:CountrySubDivisionName in the payer's legal organization's postal address.

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