Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-050: spine toc is not an NCX

Updated:

EPUBCheck OPF-050 is an error message: “TOC attribute references resource with non-NCX mime type; "application/x-dtbncx+xml" is expected.” The spine's toc attribute points to an item that is not an NCX file. In EPUB 2 (and in EPUB 3 books that keep an NCX for old readers) toc must name the NCX item.

The official message

TOC attribute references resource with non-NCX mime type; "application/x-dtbncx+xml" is expected.

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

  • toc set to the id of the navigation document instead of the NCX.
  • toc pointing at a chapter or another file by mistake.
  • The NCX declared with the wrong media type, so it does not look like an NCX.

How to fix it

  1. Find the NCX item in the manifest; its media type must be application/x-dtbncx+xml.
  2. Set the spine's toc attribute to that item's id.
  3. In an EPUB 3 without an NCX, remove the toc attribute.

When it's not this

If toc names an id that does not exist at all, that is OPF-049.

Terms used here

Other OPF messages

  • OPF-049 Item id "…" was not found in the manifest.
  • OPF-048 Package tag is missing its required unique-identifier attribute and value.
  • OPF-053 Date value "…" does not follow recommended syntax as per http://www.w3.org/TR/NOTE-datetime:….
  • OPF-054 Date value "…" is not valid as per http://www.w3.org/TR/NOTE-datetime:….
  • OPF-045 Encountered circular reference in fallback chain.
  • OPF-055 … tag is empty.

Sources

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

FAQ

What does EPUBCheck OPF-050 mean?

EPUBCheck OPF-050 is an error message: “TOC attribute references resource with non-NCX mime type; "application/x-dtbncx+xml" is expected.” The spine's toc attribute points to an item that is not an NCX file. In EPUB 2 (and in EPUB 3 books that keep an NCX for old readers) toc must name the NCX item.

Is OPF-050 an error?

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