Document identifier exactly once

Error FX-SCH-A-000019 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

In ram:ExchangedDocument, ram:ID is either missing or occurs more than once. The element must occur exactly once.

What the rule means

ram:ID contains the identifier of the invoice document. It is needed to identify the document.

Please provide the document identifier exactly once

ram:ID is missing from the document header or appears more than once. Having exactly one such element resolves this issue.

What to do
  1. Locate ram:ExchangedDocument in the XML.
  2. Check whether ram:ID is missing or occurs more than once.
  3. Ensure that ram:ID occurs exactly once.
  4. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ExchangedDocument/>
✓ Correct
<ram:ExchangedDocument>
  <ram:ID>INV-1</ram:ID>
</ram:ExchangedDocument>
Technical details

The rule uses count(ram:ID)=1 to check that ram:ID occurs exactly once in the context.

Where the rule applies

The rule applies in the invoice header element ram:ExchangedDocument.

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