At most one subdivision in the seller’s 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

CountrySubDivisionName may occur no more than once in PostalTradeAddress. The element appears more than once.

What the rule means

CountrySubDivisionName identifies a subdivision of the country in the seller’s address. This rule does not allow multiple occurrences of the element.

Please include the seller’s address subdivision no more than once

The postal address of the seller’s legal organization contains CountrySubDivisionName more than once. Remove the extra occurrence so that the element appears no more than once.

What to do
  1. Locate the postal address under SellerTradeParty and SpecifiedLegalOrganization.
  2. Check its CountrySubDivisionName elements and remove any extra occurrences.
  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 limits the number of direct CountrySubDivisionName elements in PostalTradeAddress to at most 1; zero occurrences are allowed.

Where the rule applies

The rule applies to the postal address of the seller’s legal organization in SellerTradeParty.

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