# Element content does not follow the DTD

Source: https://xmlvalid.com/errors/content-does-not-follow-the-dtd

> An element's children don't match its content model: order, count or which ones.

Example message: `Element note content does not follow the DTD, expecting (to , body), got (body to )`

## Why it happens

- Children in the wrong order. A comma in the content model means "in this order".
- A required child missing, or one appearing more often than `?`, `*` or `+` allow.

## How to fix it

- The message gives the model the DTD expects and the children it got. Rearrange the children to match.

## Example that fails

```xml
<note id="n1">
  <body>Hi</body>
  <to>Ana</to>
</note>
```

## Fixed

```xml
<note id="n1">
  <to>Ana</to>
  <body>Hi</body>
</note>
```
