Skip to content
EPUBCheck · Package document (OPF)

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

  1. Find the link element EPUBCheck points to.
  2. Point href at the real file (an audio file, a record), not at the package document.
  3. 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-097 Resource "…" is listed in the manifest, but no reference to it was found in content documents.
  • OPF-099 The manifest must not list the package document.
  • 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-100 The "…" property only applies to pre-paginated content.
  • OPF-095 The "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.

FAQ

What does EPUBCheck OPF-098 mean?

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.

Is OPF-098 an error?

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

PDF to EPUB tools

Every tool uses the same engine and starts with a free 5-page sample.