ram:BusinessProcessSpecifiedDocumentContextParameter may occur at most once

Error FX-SCH-A-000024 Factur-X

Element 'ram:BusinessProcessSpecifiedDocumentContextParameter' 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:BusinessProcessSpecifiedDocumentContextParameter occurs more than once in rsm:ExchangedDocumentContext.

What the rule means

The document context may contain no more than one parameter for the business process.

Please include the business process parameter no more than once

ram:BusinessProcessSpecifiedDocumentContextParameter occurs more than once in the document context. Remove the extra occurrences; the element may also be absent.

What to do
  1. Check rsm:ExchangedDocumentContext and keep no more than one ram:BusinessProcessSpecifiedDocumentContextParameter in it.
  2. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<rsm:ExchangedDocumentContext>
  <ram:BusinessProcessSpecifiedDocumentContextParameter/>
  <ram:BusinessProcessSpecifiedDocumentContextParameter/>
</rsm:ExchangedDocumentContext>
✓ Correct
<rsm:ExchangedDocumentContext>
  <ram:BusinessProcessSpecifiedDocumentContextParameter/>
</rsm:ExchangedDocumentContext>
Technical details

The XPath test counts the direct ram:BusinessProcessSpecifiedDocumentContextParameter elements in rsm:ExchangedDocumentContext and requires a count of no more than 1.

Where the rule applies

The rule applies within the document context, rsm:ExchangedDocumentContext.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext
Test expression (assert/@test)
count(ram:BusinessProcessSpecifiedDocumentContextParameter)<=1