EPUBCheck OPF-098: link to package element
Updated:
EPUBCheck OPF-098 is an error message: “The "href" attribute must reference resources, not elements in the package document, but found URL "…".” A metadata link's href points to an element inside the package document itself (a URL with #id). Link elements must reference resources, not parts of the package document.
The official message
The "href" attribute must reference resources, not elements in the package document, but found URL "%1$s".
- 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 link written as href="#title" or content.opf#meta1 to point at metadata in the same file.
- A voicing or record link aimed at a meta element instead of a file.
- A link copied from refines syntax, which does use #id.
How to fix it
- Find the link element EPUBCheck points to.
- Point href at the real file (an audio file, a record), not at the package document.
- To describe an element of the package, use the refines attribute with #id instead of href.
When it's not this
If a manifest item's href contains a fragment, that is OPF-091.
Terms used here
Other OPF messages
OPF-097Resource "…" is listed in the manifest, but no reference to it was found in content documents.OPF-099The manifest must not list the package document.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-100The "…" property only applies to pre-paginated content.OPF-095The "media-type" attribute of "voicing" links must be an audio MIME type, but found "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.