Buyer address subdivision may occur at most once

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:PostalTradeAddress contains more than one ram:CountrySubDivisionName. This element may occur at most once.

What the rule means

ram:CountrySubDivisionName contains the subdivision of an address. Limiting it to one element prevents repeated entries for this address detail.

Please include the buyer address subdivision no more than once

The subdivision is included more than once in the postal address of the buyer’s legal organization. You can resolve the issue by limiting this detail to at most one occurrence.

What to do
  1. Locate ram:PostalTradeAddress for the buyer’s legal organization.
  2. Count the ram:CountrySubDivisionName elements it contains.
  3. Remove duplicate entries so that the element occurs no more than once.
  4. Generate the invoice again and validate it again.
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 test counts the direct ram:CountrySubDivisionName elements in ram:PostalTradeAddress and permits zero or one.

Where the rule applies

The rule applies to the subdivision name in the postal address of the legal organization within the buyer party.

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