Specify at most one country subdivision

Error FX-SCH-A-000748 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 appear there no more than once.

What the rule means

The address contains at most one detail identifying a subdivision of the country, such as a state or province.

Please specify at most one country subdivision in the postal address

The postal address contains multiple country subdivision details. You can resolve this by keeping a single detail.

What to do
  1. Find the repeated ram:CountrySubDivisionName elements in ram:PostalTradeAddress.
  2. Keep no more than one ram:CountrySubDivisionName element there.
  3. Generate the invoice again and validate it.
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 test counts the direct ram:CountrySubDivisionName elements in context and accepts no more than one.

Where the rule applies

The rule applies to the postal address of the sales agent’s legal organization in the seller section, specifically ram:PostalTradeAddress.

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