Skip to content
EPUBCheck · NCX (EPUB 2 table of contents)

EPUBCheck NCX-004: whitespace in NCX uid

Updated:

EPUBCheck NCX-004 is a usage message: “NCX identifier ("dtb:uid" metadata) should not contain leading or trailing whitespace.” The NCX's dtb:uid value has spaces or line breaks before or after it. The identifier should match the package's unique identifier exactly, and extra whitespace can make a strict comparison fail.

The official message

NCX identifier ("dtb:uid" metadata) should not contain leading or trailing whitespace.

Default severity
Usage. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.
EPUBCheck version
5.4.0

Typical causes

  • Pretty-printed XML that put the value on its own line.
  • A value pasted with a trailing space.

How to fix it

  1. Open the NCX (usually toc.ncx) and find <meta name="dtb:uid" content="..."/>.
  2. Remove the whitespace around the value of the content attribute so it is identical to the package's dc:identifier.
  3. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

If the value is different from the package identifier, not just padded, the error is NCX-001.

Terms used here

Other NCX messages

  • NCX-006 Empty "text" label in the NCX document
  • NCX-001 NCX identifier ("…") does not match OPF identifier ("…").

Sources

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

FAQ

What does EPUBCheck NCX-004 mean?

EPUBCheck NCX-004 is a usage message: “NCX identifier ("dtb:uid" metadata) should not contain leading or trailing whitespace.” The NCX's dtb:uid value has spaces or line breaks before or after it. The identifier should match the package's unique identifier exactly, and extra whitespace can make a strict comparison fail.

Is NCX-004 an error?

NCX-004 is reported as usage by default. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.

PDF to EPUB tools

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