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
- Find the link element EPUBCheck points to.
- 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.
- 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-093The "media-type" attribute is required for linked resources located in the EPUB containerOPF-095The "media-type" attribute of "voicing" links must be an audio MIME type, but found "…".OPF-092Language tag "…" is not well-formed: …OPF-096Non-linear content must be reachable, but found no hyperlink to "…".OPF-096bNo hyperlink was found to non-linear document "…", please check that it can be reached from scripted content.OPF-091The item href URL must not have a fragment identifier.
Sources
- EPUB 3.3, §D.4.1.5 record · read
- EPUB 3.3, §D.4.1.6 voicing · read
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.