Represents an XML attribute.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Gets an empty collection of attributes.
Determines if this attribute is a namespace declaration.
Gets the expanded name of this attribute.
Gets the next attribute of the parent element.
Gets the node type for this node.(Overrides XObject.NodeType.)
Gets the previous attribute of the parent element.
Gets or sets the value of this attribute.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Removes this attribute from its parent element.
Sets the value of this attribute.
Converts the current Object.ToString().)object to a string representation.(Overrides
Overloaded. Gets the post-schema-validation infoset (PSVI) of a validated attribute.(Defined by Extensions.)
|Validate(XmlSchemaObject, XmlSchemaSet, ValidationEventHandler)|
|Validate(XmlSchemaObject, XmlSchemaSet, ValidationEventHandler, Boolean)|
An XML attribute is a name/value pair associated with an XML element.
Each XElement contains a list of the attributes for that element. Attributes must have a qualified name that is unique to the element. Attributes are not derived from XNode; they are not nodes in the XML tree. Instead, they are simply name/value pairs associated with an element.
Attributes are maintained in the XML tree in the order that they were added to the element. When a collection of attributes is returned by Attributes, they are returned in the order that they were added to the element, and are not sorted.
Technically, in XML, namespace declarations are not attributes proper. However, this distinction is not normally made by many XML programmers. Instead, because namespace declarations have exactly the same XML syntax as attributes, most XML programmers think of namespaces as attributes. To simplify the LINQ to XML programming interface, namespaces are represented in the XML tree as attributes. Such namespace attributes impact serialization of an XML tree. When serializing, LINQ to XML attempts to serialize with the namespace prefix specified in namespace attributes. You can use the IsNamespaceDeclaration to determine if an attribute is really a namespace declaration.
The XObject. You can add annotations to attributes, and observe events for them.class derives from
Available since 8
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.