# [facet 'maxLength'] The value exceeds the allowed length

Source: https://xmlvalid.com/errors/facet-length

> A value longer (or shorter) than the schema allows.

Example message: `Element 'note': [facet 'maxLength'] The value has a length of '17'; this exceeds the allowed maximum length of '10'.`

## Why it happens

- Free text longer than a field allows: names, addresses, references.
- Length is counted in characters, not bytes, after whitespace handling for the type.

## How to fix it

- Shorten the value to the limit the message gives (or lengthen it for `minLength`). Truncate deliberately where the data is produced rather than letting another system cut it.

## Example that fails

```xml
<order currency="EUR">
  <id>A-1</id>
  <qty>1</qty>
  <note>far too long text</note>
</order>
```

## Fixed

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