> For the complete documentation index, see [llms.txt](https://sevenval.gitbook.io/flat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sevenval.gitbook.io/flat/reference/actions/nameshave.md).

# nameshave Action

The `nameshave` action removes all namespaces from an XML document.

## Syntax

```markup
<nameshave in="$xml_with_namespaces" out="$no_more_namespaces"/>
```

## Usage

Stripping namespaces allows for easy access to XML elements and attributes in a JSON [`template`](/flat/reference/actions/template.md).

## Example

Input:

```markup
<root xmlns="http://example.com/ns/2019/1" xmlns:side="http://example.com/ns/2019/2">
  <a>catch me </a>
  <side:a>if you can!</side:a>
</root>
```

Output:

```markup
<root>
  <a>catch me </a>
  <a>if you can!</a>
</root>
```

## Caution

Removing namespaces is prone to ambiguity. The origin of elements carrying the same local name will be lost (see the example above).

Attributes originally in different namespaces sharing the same local name will silently override each other:

```markup
<root side:prop="1st" prop="last" xmlns:side="http://example.com/ns/2019/1"/>
```

becomes

```markup
<root prop="last"/>
```
