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.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru