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
- Find the link element EPUBCheck points to.
- Add media-type with the linked file's format, for example media-type="application/xml".
- 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-092Language tag "…" is not well-formed: …OPF-094The "media-type" attribute is required for "…" links.OPF-091The item href URL must not have a fragment identifier.OPF-095The "media-type" attribute of "voicing" links must be an audio MIME type, but found "…".OPF-090It is encouraged to use MIME media type "…" instead of "…".OPF-096Non-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.