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
- Open the NCX (usually toc.ncx) and find
<meta name="dtb:uid" content="..."/>. - Remove the whitespace around the value of the content attribute so it is identical to the package's dc:identifier.
- 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
Sources
- EPUB 3.3, §5.9.5 NCX · read
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.