Skip to content
EPUBCheck · Package document (OPF)

OPF-004b

Updated:

EPUBCheck OPF-004b is an error message: “Invalid prefix "…": must be a valid non-colonized name (aka "NCName").” A prefix name in the prefix attribute is not a valid XML name (NCName).

The official message

Invalid prefix "%1$s": must be a valid non-colonized name (aka "NCName").

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 prefix that starts with a digit or contains characters such as spaces or slashes.
  • Hand-edited or tool-generated package documents that write the prefix attribute with the wrong separators.

How to fix it

  • The prefix attribute on the package element maps short prefixes to vocabulary URIs, as space-separated pairs like prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/". Use a name made of letters, digits, hyphens and underscores, starting with a letter.
  • Reserved prefixes such as dcterms, rendition and schema need no declaration at all.

Terms used here

Other OPF messages

  • OPF-004 Invalid prefix declaration: leading or trailing whitespace is not allowed.
  • OPF-004a Invalid prefix declaration: found empty prefix.
  • OPF-004c Invalid prefix declaration: prefix "…" must be immediately followed by a colon character (":").
  • OPF-004d Invalid prefix declaration: prefix "…" must be separated by its URI with a space.
  • OPF-004e Invalid prefix declaration: found illegal whitespace between prefix and URI.
  • OPF-004f Invalid prefix declaration: found illegal whitespace between prefix mappings.

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

FAQ

What does EPUBCheck OPF-004b mean?

EPUBCheck OPF-004b is an error message: “Invalid prefix "…": must be a valid non-colonized name (aka "NCName").” A prefix name in the prefix attribute is not a valid XML name (NCName).

Is OPF-004b an error?

OPF-004b 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.