Use an allowed MIME code for the file attachment

Error FX-SCH-A-000287 Factur-X

Value of '@mimeCode' is not allowed.

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

If mimeCode contains a value that is not in the code list used by this rule, the value is not allowed. An empty value is also accepted by this test.

What the rule means

The code list defines which MIME codes are accepted for the file attachment. This ensures the media type is expressed using a defined value.

Please use an allowed MIME code for the file attachment

The supplied mimeCode value is not in the code list allowed by this rule. Use a value from that list or leave the value empty.

What to do
  1. Check the value of the mimeCode attribute on ram:AttachmentBinaryObject.
  2. Use a value listed in code list 21 or leave the value empty.
  3. Generate the invoice again and validate it once more.
Technical details

The test accepts an empty code value or a value listed in code list 21.

Where the rule applies

The rule checks the value of the mimeCode attribute of ram:AttachmentBinaryObject for the embedded document.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:AdditionalReferencedDocument[ram:TypeCode="916"]/ram:AttachmentBinaryObject
Test expression (assert/@test)
string-length($codeValue21)=0 or document('FACTUR-X_EN16931_codedb.xml')/codedb/cl[@id=21]/enumeration[@value=$codeValue21]