Address subdivision may occur at most once

Error FX-SCH-A-000901 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 the postal address of the legal organization. The rule allows at most one such element.

What the rule means

ram:CountrySubDivisionName contains the name of a subdivision of the country in the organization’s address. Limiting it to one element avoids ambiguous or repeated entries in this location.

Please include the organization address subdivision no more than once

The postal address of the invoicer’s legal organization contains ram:CountrySubDivisionName more than once. Remove the duplicate entry from the structure.

What to do
  1. Locate ram:PostalTradeAddress under the invoicer’s ram:SpecifiedLegalOrganization.
  2. Check whether ram:CountrySubDivisionName occurs more than once.
  3. Keep no more than one ram:CountrySubDivisionName in the address.
  4. 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

The test counts the direct ram:CountrySubDivisionName elements in ram:SpecifiedLegalOrganization/ram:PostalTradeAddress and allows at most one.

Where the rule applies

The rule applies to the postal address of the invoicer’s legal organization, within ram:SpecifiedLegalOrganization/ram:PostalTradeAddress.

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