At most one seller country subdivision

Error FX-SCH-A-000442 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. This element may occur there at most once.

What the rule means

The rule limits the country subdivision entry in the seller’s postal address to one element.

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

The seller’s postal address contains ram:CountrySubDivisionName more than once. Remove the extra entry so that the element occurs no more than once.

What to do
  1. Find ram:CountrySubDivisionName in ram:PostalTradeAddress.
  2. Remove any extra 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>A</ram:CountrySubDivisionName>
  <ram:CountrySubDivisionName>B</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountrySubDivisionName>A</ram:CountrySubDivisionName>
</ram:PostalTradeAddress>
Technical details

The XPath counts the child elements ram:CountrySubDivisionName in ram:PostalTradeAddress and permits at most one.

Where the rule applies

The rule applies to the seller’s postal address ram:PostalTradeAddress.

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