Provide at most one country subdivision name

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

The element ram:PostalTradeAddress contains more than one ram:CountrySubDivisionName element.

What the rule means

ram:CountrySubDivisionName contains the name of a country subdivision in the delivery address. At most one value is allowed for this field.

Please provide the delivery address’s country subdivision no more than once

The delivery recipient’s postal address contains ram:CountrySubDivisionName more than once. Remove the extra occurrence from the XML.

What to do
  1. Locate all ram:CountrySubDivisionName elements under ram:PostalTradeAddress of ram:ShipToTradeParty.
  2. Make sure no more than one such element is present.
  3. Generate the invoice again and validate it once more.
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 XPath condition allows zero or one child element named ram:CountrySubDivisionName.

Where the rule applies

The rule applies to the postal address of the delivery recipient under ShipToTradeParty for an invoice line.

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