XmlConvert.VerifyTOKEN(String) Metoda

Definice

Ověřuje, že řetězec je platný token podle části schématu W3C XML 2: Doporučení datových typů.

public:
 static System::String ^ VerifyTOKEN(System::String ^ token);
public static string? VerifyTOKEN(string? token);
public static string VerifyTOKEN(string token);
static member VerifyTOKEN : string -> string
Public Shared Function VerifyTOKEN (token As String) As String

Parametry

token
String

Řetězcová hodnota, kterou chcete ověřit.

Návraty

Token, pokud se jedná o platný token.

Výjimky

Hodnota řetězce není platný token.

Poznámky

Tato metoda zajišťuje, že token názvu odpovídá správné syntaxi platného tokenu. Lze ho použít následujícím způsobem:

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

Další informace o tokenech najdete v tématu NMTOKEN.

Platí pro