The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
XmlConvert::VerifyNMTOKEN Method (String^)
.NET Framework (current version)
Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation
Assembly: System.Xml (in System.Xml.dll)
Parameters
- name
-
Type:
System::String^
The string you wish to verify.
| Exception | Condition |
|---|---|
| XmlException | The string is not a valid name token. |
| ArgumentNullException | name is null. |
This method ensures that the name token follows the proper syntax for a valid NMTOKEN. It can be used in the following manner:
try {
writer.WriteStartElement(XmlConvert.VerifyNMTOKEN("abc"),"book");
}
catch(Exception e) {
Console.WriteLine("error");
}
For more information on the NMTOKEN data type, see http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#NMTOKEN.
Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: