﻿---
title: xml_space_before_self_closing
description: Space before />. Unset keeps what each tag has, except in .slnx files, which always get one. Defaults to `(not set)`
url: https://docs-v3-preview.elastic.dev/reference/xml/layout/xml_space_before_self_closing
---

# xml_space_before_self_closing
Space before />. Unset keeps what each tag has, except in .slnx files, which always get one.

## Values


| Value   | Notes |
|---------|-------|
| `true`  |       |
| `false` |       |

**Default:** `(not set)`
Unset, each tag keeps whether it had a space, and several spaces become one. Solution files always get one, the shape Visual Studio writes.

### `xml_space_before_self_closing = true`

```ini
xml_space_before_self_closing = true
```

<tab-set>
  <tab-item title="Before">
    ```xml
    <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
          <TargetFramework>net10.0</TargetFramework>
            <Description>
              Kept exactly as written: MSBuild reads this whitespace.
            </Description>
        </PropertyGroup>



      <ItemGroup>
        <PackageReference Include="A"/>
        <PackageReference   Include="B"   Version="1.0" />
      </ItemGroup>
    </Project>
    ```
  </tab-item>

  <tab-item title="After">
    ```xml
    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework>net10.0</TargetFramework>
            <Description>
              Kept exactly as written: MSBuild reads this whitespace.
            </Description>
      </PropertyGroup>

      <ItemGroup>
        <PackageReference Include="A" />
        <PackageReference Include="B" Version="1.0" />
      </ItemGroup>
    </Project>
    ```
  </tab-item>
</tab-set>


### `xml_space_before_self_closing = false`

```ini
xml_space_before_self_closing = false
```

<tab-set>
  <tab-item title="Before">
    ```xml
    <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
          <TargetFramework>net10.0</TargetFramework>
            <Description>
              Kept exactly as written: MSBuild reads this whitespace.
            </Description>
        </PropertyGroup>



      <ItemGroup>
        <PackageReference Include="A"/>
        <PackageReference   Include="B"   Version="1.0" />
      </ItemGroup>
    </Project>
    ```
  </tab-item>

  <tab-item title="After">
    ```xml
    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework>net10.0</TargetFramework>
            <Description>
              Kept exactly as written: MSBuild reads this whitespace.
            </Description>
      </PropertyGroup>

      <ItemGroup>
        <PackageReference Include="A"/>
        <PackageReference Include="B" Version="1.0"/>
      </ItemGroup>
    </Project>
    ```
  </tab-item>
</tab-set>