XmlConvert.VerifyTOKEN(String) メソッド

定義

W3C 勧告『XML Schema Part 2: Datatypes』に照らし合わせて、文字列が有効なトークンであることを検証します。

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

パラメーター

token
String

検証する文字列値。

戻り値

String

有効なトークンの場合は、トークン。

例外

文字列値が、有効なトークンではありません。

注釈

このメソッドは、名前トークンが有効なトークンの適切な構文に従っていることを確認します。 次の方法で使用できます。

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

トークンの詳細については、 NMTOKEN を参照してください。

適用対象