This documentation is archived and is not being maintained.

XmlSchemaKey Class

Identifies a key constraint. Represents the World Wide Web Consortium (W3C) key element.

For a list of all members of this type, see XmlSchemaKey Members.


[Visual Basic]
Public Class XmlSchemaKey
   Inherits XmlSchemaIdentityConstraint
public class XmlSchemaKey : XmlSchemaIdentityConstraint
public __gc class XmlSchemaKey : public XmlSchemaIdentityConstraint
public class XmlSchemaKey extends XmlSchemaIdentityConstraint

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Specifies that an attribute or element value (or set of values) must be a key within the specified scope. A key must be unique, non-nillable/non-nullable, and always present. The constraint name must be unique within a schema.


See XmlSchemaKeyref for an example using this class.


Namespace: System.Xml.Schema

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Xml (in System.Xml.dll)

See Also

XmlSchemaKey Members | System.Xml.Schema Namespace