# Attribute redefined

Source: https://xmlvalid.com/errors/attribute-redefined

> The same attribute appears twice on one element.

Example message: `Attribute id redefined`

## Why it happens

- A duplicated attribute after a merge or copy and paste.
- Code that adds an attribute without checking whether it is already set.

## How to fix it

- Keep one of them. If both values matter, they belong in different attributes or in child elements.

## Example that fails

```xml
<item id="1" id="2"/>
```

## Fixed

```xml
<item id="1"/>
```
