XmlConvert.VerifyNMTOKEN(String) Metodo

Definizione

Verifica che la stringa sia un tipo NMTOKEN valido in base alla raccomandazione W3C XML Schema Part2: Datatypes.

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

Parametri

name
String

Stringa da verificare.

Restituisce

String

Token del nome, se è un NMTOKEN valido.

Eccezioni

La stringa non è un nome del token valido.

name è null.

Commenti

Questo metodo garantisce che il token del nome segua la sintassi corretta per un NMTOKEN valido. Può essere usato nel modo seguente:

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

Per altre informazioni sul tipo di dati NMTOKEN, vedere la sezione NMTOKEN di XML Schema Part 2: Datatypes Second Edition.For more information on the NMTOKEN data types second Edition, see the NMTOKEN section of the XML Schema Part 2: Datatypes Second Edition.

Si applica a