# No declaration for element

Source: https://xmlvalid.com/errors/no-declaration-for-element

> The DTD does not declare an element the document uses.

Example message: `No declaration for element cc`

## Why it happens

- An element from another version of the format, or a misspelt name.
- The wrong DTD for the document.

## How to fix it

- Rename or remove the element, or declare it in the DTD with `<!ELEMENT …>` and allow it in its parent's content model. The content-model error that usually follows is the same problem.

## Example that fails

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

## Fixed

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