ram:CountrySubDivisionName may occur at most once

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

What the rule means

The structure allows at most one country subdivision entry in this postal address.

Please include `ram:CountrySubDivisionName` no more than once

ram:CountrySubDivisionName occurs more than once in the legal organisation’s postal address. This element may appear at most once in that address.

What to do
  1. Locate ram:PostalTradeAddress in the tax representative’s ram:SpecifiedLegalOrganization.
  2. Make sure it contains no more than one ram:CountrySubDivisionName.
  3. Generate the invoice again and validate it.
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 requires a count of no more than 1.

Where the rule applies

The rule applies to ram:PostalTradeAddress within ram:SpecifiedLegalOrganization for the seller’s tax representative.

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