System.Xml.XmlConvert.VerifyNCName Method

Verifies that the name is a valid NCName according to the W3C Extended Markup Language recommendation. An NCName is a name that cannot contain a colon.

Syntax

public static string VerifyNCName (string name)

Parameters

name
The name to verify.

Returns

The name, if it is a valid NCName.

Exceptions

TypeReason
ArgumentNullException name is null or string.Empty.
System.Xml.XmlException name is not a valid XML qualified name.

Remarks

If name contains a colon, System.Xml.XmlException is thrown.

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