# EPUBCheck RSC-005: schema error in a file, how to fix it

Source: https://epubcc.com/epubcheck/rsc-005/ (updated 2026-11-04)

EPUBCheck RSC-005 is an error message: “Error while parsing file: ….” A file does not follow the schema EPUB requires for it. An element, attribute or value is not allowed where it is, or something required is missing; the text after "Error while parsing file:" says which. It is the most common EPUBCheck error, and one structural mistake can cause several messages.

- Official message (EPUBCheck 5.4.0): Error while parsing file: %1$s
- Default severity: Error

## Typical causes

- "element X not allowed here" or "attribute X not allowed here": elements nested where the schema forbids them (a div inside a p), or attributes that HTML or EPUB do not define, often copied from web pages or word processors.
- "Duplicate ID": the same id value used twice in one document, often from copied footnotes or headings.
- Missing required metadata, such as the dcterms:modified date of an EPUB 3 package document, or a missing required element such as title in the XHTML head.
- "value of attribute X is invalid": a value of the wrong type, such as a date in the wrong format or an id that starts with a digit.

## How to fix it

1. Read the text after the colon: EPUBCheck reports the file, the line and column, and the parser's own description of the problem.
2. Fix the element or attribute it names: move or remove the element, delete the unknown attribute, or make the duplicate id unique and update the links that pointed to it.
3. In package documents, add the missing metadata, for example <meta property="dcterms:modified">2026-11-03T00:00:00Z</meta> (exactly one, in that format).
4. Fix the first errors first and validate again: one structural error can cause several later ones.

## When it's not this

If the file is not even well-formed XML (an unescaped & or an unclosed tag), EPUBCheck reports the fatal RSC-016 instead.

## Sources

- EPUB 3.3, §6.1.2 XHTML requirements: https://www.w3.org/TR/epub-33/#sec-xhtml-req (read 2026-11-04)
- EPUB 3.3, §5.5.5 Last modified date: https://www.w3.org/TR/epub-33/#sec-metadata-last-modified (read 2026-11-04)

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