System.Xml.XmlConvert.VerifyTOKEN Method

Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation.

Syntax

public static string VerifyTOKEN (string token)

Parameters

token
The string value you wish to verify.

Returns

The token, if it is a valid token.

Remarks

This method ensures that the name token follows the proper syntax for a valid token. It can be used in the following manner:

Example

try {
  writer.WriteStartElement(XmlConvert.VerifyTOKEN("abc"),"book");
}
catch(Exception e) {
  Console.WriteLine("error");
}

For more information on tokens, see tp://go.microsoft.com/fwlink/?LinkId=103183.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0