> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# XmlKnownNamingPolicy

> Specifies the built-in [XmlNamingPolicy](/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy) that a source-generated context uses at run time.

## Definition

**Assembly:** CloudNimble.XmlEssentials.dll

**Namespace:** CloudNimble.Text.Xml.Serialization

**Inheritance:** System.Enum

## Syntax

```csharp theme={"dark"}
CloudNimble.Text.Xml.Serialization.XmlKnownNamingPolicy
```

## Summary

Specifies the built-in [XmlNamingPolicy](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md) that a source-generated context uses at run time.

## Usage

`XmlKnownNamingPolicy` names the built-in naming policies as an enumeration, so that you can choose one in an attribute. An attribute argument has to be a compile-time constant, and an [`XmlNamingPolicy`](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy) instance isn't one.

It is the type of the `PropertyNamingPolicy`, `ElementNamingPolicy`, and `AttributeNamingPolicy` properties of [`XmlSourceGenerationOptionsAttribute`](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/Serialization/XmlSourceGenerationOptionsAttribute). It is the counterpart of `JsonKnownNamingPolicy`.

| Value | Policy | `StreetAddress` becomes |
| - | - | - |
| `Unspecified` | None. Names are unchanged. | `StreetAddress` |
| `CamelCase` | `XmlNamingPolicy.CamelCase` | `streetAddress` |
| `SnakeCaseLower` | `XmlNamingPolicy.SnakeCaseLower` | `street_address` |
| `SnakeCaseUpper` | `XmlNamingPolicy.SnakeCaseUpper` | `STREET_ADDRESS` |
| `KebabCaseLower` | `XmlNamingPolicy.KebabCaseLower` | `street-address` |
| `KebabCaseUpper` | `XmlNamingPolicy.KebabCaseUpper` | `STREET-ADDRESS` |
| `PascalCase` | `XmlNamingPolicy.PascalCase` | `StreetAddress` |

When you set options in code instead, assign an `XmlNamingPolicy` to `XmlSerializerOptions` directly. See [Use source generation](https://easyaf.nimbleapps.cloud/xmlessentials/guides/source-generation.md) and [Customize names and shape](https://easyaf.nimbleapps.cloud/xmlessentials/guides/customize-names.md#use-a-naming-policy-for-all-names).

## Remarks

The values are selected through the naming policy properties of [XmlSourceGenerationOptionsAttribute](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/Serialization/XmlSourceGenerationOptionsAttribute.md).

## Values

| Name | Value | Description |
| - | - | - |
| `Unspecified` | 0 | No naming policy. Names are not converted. |
| `CamelCase` | 1 | The built-in [XmlNamingPolicy.CamelCase](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md#camelcase) naming policy. |
| `SnakeCaseLower` | 2 | The built-in [XmlNamingPolicy.SnakeCaseLower](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md#snakecaselower) naming policy. |
| `SnakeCaseUpper` | 3 | The built-in [XmlNamingPolicy.SnakeCaseUpper](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md#snakecaseupper) naming policy. |
| `KebabCaseLower` | 4 | The built-in [XmlNamingPolicy.KebabCaseLower](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md#kebabcaselower) naming policy. |
| `KebabCaseUpper` | 5 | The built-in [XmlNamingPolicy.KebabCaseUpper](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md#kebabcaseupper) naming policy. |
| `PascalCase` | 6 | The built-in [XmlNamingPolicy.PascalCase](https://easyaf.nimbleapps.cloud/xmlessentials/api-reference/CloudNimble/Text/Xml/XmlNamingPolicy.md#pascalcase) naming policy. |

## Related APIs

* CloudNimble.Text.Xml.XmlNamingPolicy
* CloudNimble.Text.Xml.Serialization.XmlSourceGenerationOptionsAttribute
* CloudNimble.Text.Xml.Serialization.XmlSerializerContext
* CloudNimble.Text.Xml.XmlSerializerOptions


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.