Specify exactly one document profile

Error FX-SCH-A-000025 Factur-X

Element 'ram:GuidelineSpecifiedDocumentContextParameter' 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

Within rsm:ExchangedDocumentContext, ram:GuidelineSpecifiedDocumentContextParameter does not occur exactly once. The element is missing or appears more than once.

What the rule means

The document profile identifies the guideline that applies to the invoice. Exactly one profile context is required.

Please include exactly one document profile context

The document context is missing the document profile entry, or it appears more than once. You can resolve this by having exactly one such entry there.

What to do
  1. Find ram:GuidelineSpecifiedDocumentContextParameter in rsm:ExchangedDocumentContext.
  2. Add the element if it is missing, or remove duplicates so that only one remains.
What it looks like
✗ Triggers the message
<rsm:ExchangedDocumentContext/>
✓ Correct
<rsm:ExchangedDocumentContext>
  <ram:GuidelineSpecifiedDocumentContextParameter/>
</rsm:ExchangedDocumentContext>
Technical details

The XPath test counts the direct child elements ram:GuidelineSpecifiedDocumentContextParameter and requires the count to be 1.

Where the rule applies

The rule applies within the document context rsm:ExchangedDocumentContext and checks the element ram:GuidelineSpecifiedDocumentContextParameter.

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