Allowed MIME code for the attached document

Error BR-DEX-01 XRechnung

The element <name/> "Attached Document" (BT-125) uses an impermissible MIME code: <value-of select="@mimeCode"/>. In the case of an extension, the MIME code application/xml may additionally be used in addition to the list of MIME codes (defined in section 8.2, "Binary Object").

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 in ram:AttachmentBinaryObject is not one of the MIME codes allowed by this rule. For an extension, application/xml is also allowed in addition to the listed document types.

What the rule means

The MIME code describes the format of the attached document. An allowed code identifies the content as a supported format.

Affected fields BT-125
Please choose an allowed MIME code for the attached document

The MIME code for the attached document in ram:AttachmentBinaryObject is not accepted by this rule. You can replace it with one of the allowed codes.

What to do
  1. Check the value of mimeCode for AdditionalReferencedDocument.AttachmentBinaryObject.
  2. Choose one of the allowed codes, such as application/pdf or, for an extension, application/xml.
  3. Check the call to AddAdditionalReferencedDocument(...).
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:AttachmentBinaryObject mimeCode="application/octet-stream">...</ram:AttachmentBinaryObject>
✓ Correct
<ram:AttachmentBinaryObject mimeCode="application/pdf">...</ram:AttachmentBinaryObject>
Check in FactoorSharp
  • AdditionalReferencedDocument.AttachmentBinaryObject (BT-125)
  • AdditionalReferencedDocument.Filename (BT-125-2)
  • FacturXInvoice.AddAdditionalReferencedDocument(id, typeCode, issueDateTime, name, referenceTypeCode, attachmentBinaryObject, filename, uriID) (attachmentBinaryObject: BT-125)
Technical details

The test compares @mimeCode directly with the allowed values: PDF, PNG, JPEG, CSV, two spreadsheet formats, and application/xml.

Where the rule applies

The rule applies to ram:AttachmentBinaryObject for an extension. It checks the mimeCode attribute of the attached document.

Original message from the Schematron
Das Element <name/> "Attached Document" (BT-125) benutzt einen nicht zulässigen MIME-Code: <value-of select="@mimeCode"/>. Im Falle einer Extension darf zusätzlich zu der Liste der mime codes (definiert in Abschnitt 8.2, "Binary Object") der MIME-Code application/xml genutzt werden.
Context (rule/@context)
ram:AttachmentBinaryObject[$isExtension]
Test expression (assert/@test)
.[ @mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml' ]
Changes in the KoSIT validation rules
  • 2024-10-312024-10-31 · AddedCustom level for BR-CL-24 in CII Extension to support BR-DEX-01