Premature end of data in tag

The document ends while an element is still open.

The message, as the validator reports it
Premature end of data in tag note line 1

Why it happens

  • A missing end tag, usually for the root element.
  • A file that was cut off: an interrupted download, a full disk, a process that died while writing.
  • An unclosed comment or CDATA section that swallowed the rest of the file.

How to fix it

The message names the element still open and the line it started on. If the end tag is simply missing, add it. If the file looks truncated, get a complete copy and compare its size with the original.

Example

Reports the error
<note>
  <to>Ana</to>
Fixed
<note>
  <to>Ana</to>
</note>