Language identifier no more than once

Error FX-SCH-A-000315 Factur-X

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

In ram:ExchangedDocument, ram:LanguageID occurs more than once. The element may occur no more than once.

What the rule means

ram:LanguageID is an optional element for specifying the language of the document. Multiple occurrences of this element are not allowed in the header.

Please provide the language identifier no more than once

ram:LanguageID appears multiple times in the document header. Remove the extra occurrences so that the element appears no more than once.

What to do
  1. Locate ram:ExchangedDocument in the XML.
  2. Check how many times ram:LanguageID occurs inside it.
  3. Remove extra ram:LanguageID elements so that no more than one remains.
  4. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ExchangedDocument>
  <ram:LanguageID>de</ram:LanguageID>
  <ram:LanguageID>en</ram:LanguageID>
</ram:ExchangedDocument>
✓ Correct
<ram:ExchangedDocument>
  <ram:LanguageID>de</ram:LanguageID>
</ram:ExchangedDocument>
Technical details

The rule uses count(ram:LanguageID)<=1 to ensure that zero or one ram:LanguageID occurs 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:LanguageID)<=1