Use an allowed MIME type for the attachment

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

The value of @mimeCode is not included in the code list allowed for this attribute. An empty value is not rejected by this check.

What the rule means

A non-empty MIME code must match an entry in the code list defined for @mimeCode, so that the attachment is identified with a media type defined there.

Please use an allowed MIME type for the file attachment

The value entered for @mimeCode on the attachment to the referenced document with the value 916 is not allowed. Use a value from the designated code list or leave the value empty.

What to do
  1. Find the ram:AttachmentBinaryObject in the referenced document with the ram:TypeCode value 916.
  2. Check the @mimeCode value against the code list designated for this attribute; an empty value is also allowed.
  3. Generate the invoice again and validate it again.
Good to know

An empty value is also allowed.

Technical details

The check accepts an empty value or a value present in code list ID 19 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

On the ram:AttachmentBinaryObject of the ram:AdditionalReferencedDocument whose ram:TypeCode has the value 916.

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