System.Xml.XmlWriter.WriteNmToken Method

When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).

Syntax

public virtual void WriteNmToken (string name)

Parameters

name
The name to write.

Exceptions

TypeReason
ArgumentException name is null or string.Empty; or name is not a valid XML Nmtoken.
InvalidOperationExceptionThe XmlWriter.WriteState is WriteState.Closed.

Remarks

For the asynchronous version of this method, see XmlWriter.WriteNmTokenAsync(string).

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