# EPUBCheck OPF-004: Invalid prefix declaration: leading or…

Source: https://epublab.com/epubcheck/opf-004/ (updated 2026-11-03)

EPUBCheck OPF-004 is a warning message: “Invalid prefix declaration: leading or trailing whitespace is not allowed.” A prefix declaration in the package document has leading or trailing whitespace.

- Official message (EPUBCheck 5.4.0): Invalid prefix declaration: leading or trailing whitespace is not allowed.
- Default severity: Warning

## Typical causes

- Spaces or line breaks at the start or end of the prefix attribute value.
- 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/". Remove the whitespace at the start and end of the value.
- Reserved prefixes such as dcterms, rendition and schema need no declaration at all.

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