At most one seller VAT identifier

Error FX-SCH-A-001041 Factur-X

Element variant 'ram:SpecifiedTaxRegistration[ram:ID/@schemeID="VA"]' 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

There is more than one ram:SpecifiedTaxRegistration whose ram:ID has the attribute schemeID="VA".

What the rule means

The code VA identifies a VAT identifier. The XML structure allows at most one tax registration of this type in this seller-item context.

Please provide no more than one VAT identifier for the seller item

Several tax registrations with schemeID="VA" are specified for the seller item. This identifier denotes a VAT identifier, and no more than one is allowed here.

What to do
  1. Find the ram:SpecifiedTaxRegistration elements with ram:ID and schemeID="VA" in ram:ItemSellerTradeParty.
  2. Make sure no more than one of these elements is present.
  3. Regenerate the invoice and check it again.
What it looks like
✗ Triggers the message
<ram:ItemSellerTradeParty>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">ID-1</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">ID-2</ram:ID>
  </ram:SpecifiedTaxRegistration>
</ram:ItemSellerTradeParty>
✓ Correct
<ram:ItemSellerTradeParty>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="VA">ID-1</ram:ID>
  </ram:SpecifiedTaxRegistration>
</ram:ItemSellerTradeParty>
Technical details

The rule counts ram:SpecifiedTaxRegistration elements whose child ram:ID has @schemeID="VA" and requires no more than one.

Where the rule applies

The rule applies to the tax registrations of ram:ItemSellerTradeParty within the agreement for an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:ItemSellerTradeParty
Test expression (assert/@test)
count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID="VA"])<=1