This documentation is archived and is not being maintained.

Validate the Element and Attribute Names 

The XmlConvert class contains two methods that check the characters in a name, and verifies that the name conforms to the rules set by the World Wide Web Consortium (W3C) in the Extensible Markup Language (XML) 1.0 (Second Edition) recommendation. The methods are:

The VerifyName method checks the characters and verifies that the name is valid. If the name is valid, it is returned from the method. If the name is not valid, an exception is thrown.

The VerifyNCName method does the same function as VerifyName. However, it takes the non-qualified name as its parameter.

The following code example shows how VerifyName checks the name abc before using the name as an element name.

try {
catch (XmlException e){

See Also