CountrySubDivisionName no more than once

Error FX-SCH-A-000683 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 tax representative’s postal address.

What the rule means

The rule limits the name of a country subdivision in this postal address to no more than one element.

Please include the country subdivision name no more than once

ram:CountrySubDivisionName appears more than once in the buyer’s tax representative’s postal address. You can resolve this by limiting the entry to one element.

What to do
  1. Look for repeated ram:CountrySubDivisionName elements in the buyer’s tax representative’s postal address.
  2. Remove the extra elements so that no more than one remains.
  3. Generate the invoice again and validate it.
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 context is ram:PostalTradeAddress; the check verifies that it contains no more than one direct ram:CountrySubDivisionName element.

Where the rule applies

The rule applies to the buyer’s tax representative’s postal address, specifically ram:CountrySubDivisionName.

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