Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-028: prefix used but undeclared

Updated:

EPUBCheck OPF-028 is an error message: “Undeclared prefix: "…".” A property uses a prefix that is not declared in the package document's prefix attribute. Apart from the reserved prefixes, every prefix must be mapped to a vocabulary URI before it can be used.

The official message

Undeclared prefix: "%1$s".

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

  • Vendor properties such as ibooks:version used without declaring the ibooks prefix.
  • The prefix attribute was removed or cleaned up while properties still use it.
  • A typo in the prefix of a property, so it no longer matches the declared one.

How to fix it

  1. Read the prefix EPUBCheck names.
  2. Add its mapping to the prefix attribute of the package element. Write each mapping as the prefix name, a colon, one space and the vocabulary URI, and separate mappings with whitespace, for example prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/ foaf: http://xmlns.com/foaf/spec/".
  3. Or, if the property is not needed, remove it.

When it's not this

If the prefix is declared but the declaration is badly written, that is a variant of OPF-004.

Terms used here

Other OPF messages

  • OPF-027 Undefined property: "…".
  • OPF-029 The file "…" does not appear to match the media type …, as specified in the OPF file.
  • OPF-026 Found malformed property value: "…".
  • OPF-030 The unique-identifier "…" was not found.
  • OPF-025 Property value list "…" is not allowed, only one value must be specified.
  • OPF-031 File listed in reference element in guide was not declared in OPF manifest: ….

Sources

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

FAQ

What does EPUBCheck OPF-028 mean?

EPUBCheck OPF-028 is an error message: “Undeclared prefix: "…".” A property uses a prefix that is not declared in the package document's prefix attribute. Apart from the reserved prefixes, every prefix must be mapped to a vocabulary URI before it can be used.

Is OPF-028 an error?

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

PDF to EPUB tools

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