EPUBCheck RSC-016: file is not well-formed XML
Updated:
EPUBCheck RSC-016 is a fatal error message: “Fatal Error while parsing file: ….” A file is not well-formed XML, so it cannot be parsed at all. EPUB content documents must be valid XML, and reading apps may show an error page or nothing at all for that chapter.
The official message
Fatal Error while parsing file: %1$s
- Default severity
- Fatal error. EPUBCheck could not continue checking this part of the EPUB. The file is invalid.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- An unescaped & in text or in a URL (it must be written &).
- HTML named entities such as that XML does not define.
- Unclosed or mismatched tags, or an attribute without quotes.
How to fix it
- Read the text after the colon: EPUBCheck reports the file, the line and column, and the parser's own description of the problem.
- Escape & as &, replace named entities with numeric ones (  for a non-breaking space), and close every tag.
- Validate again: once the file parses, schema errors (RSC-005) may appear that were hidden before.
When it's not this
If the XML parses but an element or attribute is not allowed, the error is RSC-005.
Terms used here
Other RSC messages
RSC-015A fragment identifier is required for svg use tag references.RSC-017Warning while parsing file: …RSC-014Fragment identifier defines an incompatible resource type.RSC-013Fragment identifier is used in a reference to a stylesheet resource.RSC-019EPUBs with Multiple Renditions should contain a META-INF/metadata.xml file.RSC-012Fragment identifier is not defined.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.