# Entity not defined

Source: https://xmlvalid.com/errors/entity-not-defined

> The document uses a named entity, like &amp;nbsp;, that XML does not know.

Example message: `Entity 'nbsp' not defined`

## Why it happens

- HTML entities copied into XML: `&nbsp;`, `&copy;`, `&eacute;`, `&mdash;`… XML defines only five: `&lt;`, `&gt;`, `&amp;`, `&quot;` and `&apos;`.
- An entity declared in a DTD that is not loaded.

## How to fix it

- Replace the entity with the character itself (the document is UTF-8 by default), or with a numeric reference: `&#160;` for a non-breaking space, `&#169;` for ©. If the entity belongs to a DTD, declare that DTD in the document.

## Example that fails

```xml
<p>Price:&nbsp;10</p>
```

## Fixed

```xml
<p>Price:&#160;10</p>
```
