System.Xml.XmlConvert.EncodeNmToken Method

Verifies the name is valid according to the XML specification.

Syntax

public static string EncodeNmToken (string name)

Parameters

name
The name to be encoded.

Returns

The encoded name.

Remarks

This method guarantees that the name is valid according to the XML specification. For example, if you passed this method the invalid name 70+, it returns 70_x002b_ which is a valid XML name.

If name is null or String.Empty then you get the same value returned.

Example

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0