Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-093: local link without media type

Updated:

EPUBCheck OPF-093 is an error message: “The "media-type" attribute is required for linked resources located in the EPUB container.” A link element in the metadata points to a file inside the EPUB but has no media-type attribute. For local resources EPUB requires the media type, so reading apps know what the linked file is.

The official message

The "media-type" attribute is required for linked resources located in the EPUB container

Default severity
Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
EPUBCheck version
5.4.0

Typical causes

  • A metadata link to a local record or file written without media-type.
  • A link copied from an example that pointed to a remote file.
  • A tool that writes link elements without attributes beyond href and rel.

How to fix it

  1. Find the link element EPUBCheck points to.
  2. Add media-type with the linked file's format, for example media-type="application/xml".
  3. Check that the file really exists in the archive at that path.

When it's not this

If the link is a record or voicing link (local or remote) without media-type, EPUBCheck reports OPF-094.

Terms used here

Other OPF messages

  • OPF-092 Language tag "…" is not well-formed: …
  • OPF-094 The "media-type" attribute is required for "…" links.
  • OPF-091 The item href URL must not have a fragment identifier.
  • OPF-095 The "media-type" attribute of "voicing" links must be an audio MIME type, but found "…".
  • OPF-090 It is encouraged to use MIME media type "…" instead of "…".
  • OPF-096 Non-linear content must be reachable, but found no hyperlink to "…".

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck OPF-093 mean?

EPUBCheck OPF-093 is an error message: “The "media-type" attribute is required for linked resources located in the EPUB container.” A link element in the metadata points to a file inside the EPUB but has no media-type attribute. For local resources EPUB requires the media type, so reading apps know what the linked file is.

Is OPF-093 an error?

OPF-093 is reported as error by default. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.