Skip to content
EPUBCheck · Package document (OPF)

OPF-004a

Updated:

EPUBCheck OPF-004a is an error message: “Invalid prefix declaration: found empty prefix.” The prefix attribute contains an empty prefix (a colon with no name before it).

The official message

Invalid prefix declaration: found empty prefix.

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

  • A stray colon, or a URI written where the prefix name should be.
  • 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/". Give every mapping a name before the colon.
  • 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-004b Invalid prefix "…": must be a valid non-colonized name (aka "NCName").
  • 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-004a mean?

EPUBCheck OPF-004a is an error message: “Invalid prefix declaration: found empty prefix.” The prefix attribute contains an empty prefix (a colon with no name before it).

Is OPF-004a an error?

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