ebooknexus.

RSC-016: element must be terminated by the matching end-tag

Epubcheck reports: FATAL(RSC-016): Fatal Error while parsing file: The element type "p" must be terminated by the matching end-tag "</p>". A tag is opened and never closed, and the XML parser gives up.

What it means

Epub content files must be well-formed XML. In XML, every opened element must be closed, no exceptions. When the parser reaches the end of the file (or the end of the parent element) with a tag still open, it stops with a fatal error. Fatal means exactly that: nothing after the broken point gets parsed, and strict reading systems refuse the chapter or the whole book.

Why it happens

How to fix it

Go to the reported line and close the element, or make it self-closing if it is a void element like br or hr. One warning from experience: a single unclosed tag near the top of a file can cascade into hundreds of follow-up errors further down, because everything after it is nested wrong. Fix the first reported error in the file, re-check, and watch most of the rest disappear before you touch anything else.

The checker pinpoints the line and shows the surrounding source right in the report, so you can see the broken tag without unpacking the book.

Find the broken tag

All Epub error codes, explained