At most one CountrySubDivisionName

Error FX-SCH-A-000875 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

PostalTradeAddress contains CountrySubDivisionName more than once. This element may occur there no more than once.

What the rule means

The rule limits the subdivision of the country specified in the postal address to one element.

Please include no more than one country subdivision in the invoicee’s postal address

CountrySubDivisionName appears more than once in the invoicee’s postal address. You can fix this by limiting the information to no more than one element.

What to do
  1. Find PostalTradeAddress in the invoicee’s address.
  2. Check how many times CountrySubDivisionName occurs in it.
  3. Keep no more than one CountrySubDivisionName element.
  4. Generate the invoice again 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

Within PostalTradeAddress, the number of direct CountrySubDivisionName elements is counted; the test passes when there is at most one.

Where the rule applies

The rule applies to the postal address of the invoicee in InvoiceeTradeParty.

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