# Character content other than whitespace is not allowed

Source: https://xmlvalid.com/errors/character-content-element-only

> Text directly inside an element that may contain only child elements.

Example message: `Element 'order': Character content other than whitespace is not allowed because the content type is 'element-only'.`

## Why it happens

- Stray text between child elements: a leftover value, a misplaced closing tag.
- A value written into the parent instead of into the child it belongs to.

## How to fix it

- Move the text into the right child element or remove it. Whitespace and line breaks are fine; anything else is not.

## Example that fails

```xml
<order currency="EUR">hello
  <id>A-1</id>
  <qty>1</qty>
</order>
```

## Fixed

```xml
<order currency="EUR">
  <id>A-1</id>
  <qty>1</qty>
  <note>hello</note>
</order>
```
