# BR-DEX-01 Attached document uses a disallowed MIME code

The MIME code of the Attached document (BT-125) must be from the allowed list. In the XRechnung Extension the code application/xml is additionally permitted beyond the codes defined for a binary object.

## Problem Description

> **ERROR**: XRechnung extension rule (KoSIT, BR-DEX) · XRechnung 3.0

## Context and Significance

This XRechnung Extension rule only fires when the invoice uses the Extension profile, which widens the binary-object MIME list to also allow application/xml.

## Solution

Set @mimeCode on the embedded binary object to an allowed value (for example application/pdf, image/png), or application/xml when the Extension carries an XML attachment. If you do not need Extension attachment types, the standard XRechnung CIUS profile avoids this rule.

- [Validate XML](/en/xrechnung-validator?source=resource&rule=BR-DEX-01)
- [Convert invoice](/en/pdf-to-xrechnung?source=resource&rule=BR-DEX-01)

## Valid Examples

- EmbeddedDocumentBinaryObject with mimeCode="application/pdf"
- Extension attachment with mimeCode="application/xml"

## Invalid Examples

- EmbeddedDocumentBinaryObject with mimeCode="application/zip"

## Code Examples

### Valid XML
```
<cac:AdditionalDocumentReference>
  <cbc:ID>REP-01</cbc:ID>
  <cac:Attachment>
    <cbc:EmbeddedDocumentBinaryObject mimeCode="application/xml"
      filename="detail.xml">UEsDBB...</cbc:EmbeddedDocumentBinaryObject>
  </cac:Attachment>
</cac:AdditionalDocumentReference>
```

### Invalid XML
```
<cac:AdditionalDocumentReference>
  <cbc:ID>REP-01</cbc:ID>
  <cac:Attachment>
    <cbc:EmbeddedDocumentBinaryObject mimeCode="application/zip"
      filename="detail.zip">UEsDBB...</cbc:EmbeddedDocumentBinaryObject>
  </cac:Attachment>
</cac:AdditionalDocumentReference>
```

## Affected Fields

- [BT-125 Attached document](/resources/xrechnung/bt-125-attached-document)

## Related Rules

- [BR-DE-21](/resources/kosit-validator-errors/br-de-21-specification-identifier-syntax)

## Validation Tools

- [Official KoSIT Validator](https://github.com/itplr-kosit/validator): Run the official KoSIT validator with the XRechnung configuration to check EN 16931 and XRechnung rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Find validation errors during conversion and review each correction.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [All validation errors](/resources/kosit-validator-errors): Overview of the EN 16931, XRechnung and Peppol validation rules explained here.
