Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-094: link needs a media type

Updated:

EPUBCheck OPF-094 is an error message: “The "media-type" attribute is required for "…" links.” A metadata link of a type that requires a media type has none. EPUB requires media-type on record and voicing links, and EPUBCheck names the rel value.

The official message

The "media-type" attribute is required for "%1$s" links.

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

%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.

Typical causes

  • A rel="record" link to an external metadata record without media-type.
  • A rel="voicing" link to an audio file without media-type.
  • A link copied from an example that left the attribute out.

How to fix it

  1. Find the link element EPUBCheck points to.
  2. Add media-type with the real format of the linked file, for example media-type="application/xml" for a record or media-type="audio/mpeg" for an MP3 voicing.
  3. For a record whose format the media type does not identify, also add an identifying property such as properties="onix".

When it's not this

If the link is a voicing link with a non-audio media type, that is OPF-095.

Terms used here

Other OPF messages

  • OPF-093 The "media-type" attribute is required for linked resources located in the EPUB container
  • OPF-095 The "media-type" attribute of "voicing" links must be an audio MIME type, but found "…".
  • OPF-092 Language tag "…" is not well-formed: …
  • OPF-096 Non-linear content must be reachable, but found no hyperlink to "…".
  • OPF-096b No hyperlink was found to non-linear document "…", please check that it can be reached from scripted content.
  • OPF-091 The item href URL must not have a fragment identifier.

Sources

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

FAQ

What does EPUBCheck OPF-094 mean?

EPUBCheck OPF-094 is an error message: “The "media-type" attribute is required for "…" links.” A metadata link of a type that requires a media type has none. EPUB requires media-type on record and voicing links, and EPUBCheck names the rel value.

Is OPF-094 an error?

OPF-094 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.