At most one CountrySubDivisionName

Error FX-SCH-A-001049 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. The element may appear at most once in this context.

What the rule means

The rule limits the number of subdivision-name entries in this postal address to one.

Please include no more than one `ram:CountrySubDivisionName` in the postal address

The item seller’s postal address contains multiple ram:CountrySubDivisionName elements. You can resolve this by limiting the entry to one element.

What to do
  1. Find the ram:PostalTradeAddress of the ram:ItemSellerTradeParty on the affected invoice line.
  2. Count the ram:CountrySubDivisionName elements it contains.
  3. Generate the invoice again and validate it once more.
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 the ram:PostalTradeAddress context and requires the count to be no greater than one.

Where the rule applies

The rule applies to the postal address ram:PostalTradeAddress of the item seller ram:ItemSellerTradeParty on an invoice line.

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