At most one buyer organization country subdivision

Error FX-SCH-A-000701 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 this 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 organization’s country subdivision no more than once

The buyer organization’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 ram:PostalTradeAddress in the buyer’s ram:SpecifiedLegalOrganization.
  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 postal address within the buyer’s ram:SpecifiedLegalOrganization. ram:CountrySubDivisionName may occur there no more than once.

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