At most one subdivision in the organization address

Error FX-SCH-A-000780 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 address may contain no more than one entry for the country's subdivision.

Please use no more than one subdivision field in the organization address

ram:CountrySubDivisionName appears more than once in the postal address of the seller's legal organization. No more than one element is allowed for this information.

What to do
  1. Open ram:PostalTradeAddress within ram:SpecifiedLegalOrganization.
  2. Keep no more than one ram:CountrySubDivisionName in it.
  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 child elements of ram:PostalTradeAddress and allows zero or one.

Where the rule applies

The rule applies to ram:CountrySubDivisionName in the postal address within the seller's ram:SpecifiedLegalOrganization.

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