At most one buyer country subdivision

Error FX-SCH-A-000167 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 buyer’s ram:PostalTradeAddress.

What the rule means

The country subdivision, such as a state or province, is specified at most once in this address.

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

The buyer’s postal address contains the country subdivision more than once. You can adjust the address so this entry appears no more than once.

What to do
  1. Check the buyer’s ram:PostalTradeAddress.
  2. Keep ram:CountrySubDivisionName there no more than once.
  3. Regenerate the invoice 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

The XPath counts direct ram:CountrySubDivisionName elements in the current ram:PostalTradeAddress and allows no more than one.

Where the rule applies

The rule applies to the buyer’s postal address in the trade agreement. ram:CountrySubDivisionName may occur there no more than once.

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