No more than one subdivision in the postal address

Error FX-SCH-A-000663 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 may occur no more than once in ram:PostalTradeAddress. Multiple occurrences of this element are not allowed.

What the rule means

The rule prevents ambiguous repeated subdivision entries in a single postal address.

Please enter the subdivision no more than once

The legal organization’s postal address contains ram:CountrySubDivisionName more than once. This element may appear there only once.

What to do
  1. Locate the postal address under ram:SpecifiedLegalOrganization.
  2. Remove any extra occurrences of ram:CountrySubDivisionName.
  3. Regenerate the invoice and validate it again.
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 child elements ram:CountrySubDivisionName of ram:PostalTradeAddress and allows zero or one element.

Where the rule applies

The rule applies to ram:PostalTradeAddress within ram:SpecifiedLegalOrganization of the buyer agent.

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