At most two manufacturer tax registrations with scheme FC

Error FX-SCH-A-000385 Factur-X

Element variant 'ram:SpecifiedTaxRegistration[ram:ID/@schemeID="FC"]' may occur at maximum 2 times.

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

The manufacturer section contains more than two ram:SpecifiedTaxRegistration elements whose child ram:ID has the attribute schemeID="FC".

What the rule means

The rule limits the number of manufacturer tax registrations using scheme FC to two. More than two such entries do not conform to the specified XML structure.

Please limit the manufacturer tax registrations with `FC` to two

More than two tax registrations with scheme FC are provided for a product’s manufacturer. You can adjust the number to the permitted maximum.

What to do
  1. Count the ram:SpecifiedTaxRegistration elements with ram:ID/@schemeID="FC" in the manufacturer section.
  2. Make sure there are no more than two such elements.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ManufacturerTradeParty>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="FC">A</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="FC">B</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="FC">C</ram:ID>
  </ram:SpecifiedTaxRegistration>
</ram:ManufacturerTradeParty>
✓ Correct
<ram:ManufacturerTradeParty>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="FC">A</ram:ID>
  </ram:SpecifiedTaxRegistration>
  <ram:SpecifiedTaxRegistration>
    <ram:ID schemeID="FC">B</ram:ID>
  </ram:SpecifiedTaxRegistration>
</ram:ManufacturerTradeParty>
Technical details

The check counts ram:SpecifiedTaxRegistration elements whose ram:ID/@schemeID is exactly FC; zero to two are allowed.

Where the rule applies

The rule applies to ram:SpecifiedTaxRegistration within the manufacturer details of a product on an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedTradeProduct/ram:ManufacturerTradeParty
Test expression (assert/@test)
count(ram:SpecifiedTaxRegistration[ram:ID/@schemeID="FC"])<=2