At most one subdivision in the payer’s legal organization address

Error FX-SCH-A-000942 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

In ram:PostalTradeAddress, ram:CountrySubDivisionName occurs more than once. The element may occur at most once.

What the rule means

The payer’s legal organization address may contain at most one name for a subdivision of the country.

Please include at most one subdivision in the payer’s legal organization address

The payer’s legal organization address contains ram:CountrySubDivisionName more than once. This element may appear at most once.

What to do
  1. Find ram:PostalTradeAddress within the payer’s ram:SpecifiedLegalOrganization.
  2. Make sure ram:CountrySubDivisionName occurs no more than once in it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedLegalOrganization>
  <ram:PostalTradeAddress>
    <ram:CountrySubDivisionName>A</ram:CountrySubDivisionName>
    <ram:CountrySubDivisionName>B</ram:CountrySubDivisionName>
  </ram:PostalTradeAddress>
</ram:SpecifiedLegalOrganization>
✓ Correct
<ram:SpecifiedLegalOrganization>
  <ram:PostalTradeAddress>
    <ram:CountrySubDivisionName>A</ram:CountrySubDivisionName>
  </ram:PostalTradeAddress>
</ram:SpecifiedLegalOrganization>
Technical details

The Schematron condition counts the child elements ram:CountrySubDivisionName and allows no more than one occurrence.

Where the rule applies

The rule applies to ram:PostalTradeAddress within the payer’s ram:SpecifiedLegalOrganization.

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