Export (0) Print
Expand All

XmlConvert.VerifyTOKEN Method

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

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public static string VerifyTOKEN(
	string token
)

Parameters

token
Type: System.String

The string value you wish to verify.

Return Value

Type: System.String
The token, if it is a valid token.

ExceptionCondition
XmlException

The string value is not a valid token.

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

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

For more information on tokens, see http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#token.

.NET Framework

Supported in: 4.6, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft