At most one subdivision in the buyer agent’s postal address

Error FX-SCH-A-000659 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 buyer agent’s ram:PostalTradeAddress contains more than one ram:CountrySubDivisionName. This element may occur in the address at most once.

What the rule means

The limit ensures that no more than one subdivision is specified in this postal address.

Please include no more than one subdivision in the buyer agent’s postal address

ram:CountrySubDivisionName appears more than once in the buyer agent’s postal address. You can fix the structure by keeping no more than one entry.

What to do
  1. Check ram:PostalTradeAddress for the buyer agent.
  2. Remove extra ram:CountrySubDivisionName elements so that no more than one remains.
  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

Within ram:PostalTradeAddress, the number of direct ram:CountrySubDivisionName elements is checked; zero or one is allowed.

Where the rule applies

The rule applies to ram:CountrySubDivisionName within the buyer agent’s ram:PostalTradeAddress postal address.

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