# Premature end of data in tag

Source: https://xmlvalid.com/errors/premature-end-of-data

> The document ends while an element is still open.

Example message: `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 that fails

```xml
<note>
  <to>Ana</to>
```

## Fixed

```xml
<note>
  <to>Ana</to>
</note>
```
