Exactly one ID for the VA tax registration

Error FX-SCH-A-001054 Factur-X

Element 'ram:ID' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

ram:ID does not occur exactly once in the relevant ram:SpecifiedTaxRegistration. The rule requires exactly one such element.

What the rule means

The rule ensures that the tax registration with schemeID="VA" contains exactly one identifier.

Please provide exactly one `ram:ID` for the item seller’s VA tax registration

The item seller’s VA tax registration does not contain exactly one ram:ID element. You can check the number of identifier elements accordingly.

What to do
  1. Find the ram:SpecifiedTaxRegistration with ram:ID and schemeID="VA".
  2. Check that it contains exactly one direct ram:ID element.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:SpecifiedTaxRegistration>
  <ram:ID schemeID="VA">A</ram:ID>
  <ram:ID schemeID="VA">B</ram:ID>
</ram:SpecifiedTaxRegistration>
✓ Correct
<ram:SpecifiedTaxRegistration>
  <ram:ID schemeID="VA">A</ram:ID>
</ram:SpecifiedTaxRegistration>
Technical details

The XPath test counts the direct ram:ID elements in the relevant ram:SpecifiedTaxRegistration and requires exactly one.

Where the rule applies

The rule applies to the item seller’s ram:SpecifiedTaxRegistration whose ram:ID has the schemeID="VA" attribute.

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