XmlConvert.VerifyNMTOKEN(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation.
public:
static System::String ^ VerifyNMTOKEN(System::String ^ name);
public static string VerifyNMTOKEN (string name);
static member VerifyNMTOKEN : string -> string
Public Shared Function VerifyNMTOKEN (name As String) As String
Parameters
- name
- String
The string you wish to verify.
Returns
The name token, if it is a valid NMTOKEN.
Exceptions
The string is not a valid name token.
name
is null
.
Remarks
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 the NMTOKEN section of the XML Schema Part 2: Datatypes Second Edition.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort: Gedurende 2024 worden GitHub Issues uitgefaseerd als het feedbackmechanisme voor inhoud. Dit wordt vervangen door een nieuw feedbacksysteem. Ga voor meer informatie naar:Feedback verzenden en bekijken voor