XAttribute XAttribute XAttribute XAttribute Class
Represents an XML attribute.
public ref class XAttribute : System::Xml::Linq::XObject
public class XAttribute : System.Xml.Linq.XObject
type XAttribute = class inherit XObject
Public Class XAttribute Inherits XObject
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.
|XAttribute(XAttribute) XAttribute(XAttribute) XAttribute(XAttribute) XAttribute(XAttribute)|
|XAttribute(XName, Object) XAttribute(XName, Object) XAttribute(XName, Object) XAttribute(XName, Object)||
Initializes a new instance of the XAttribute class from the specified name and value.
|Changed Changed Changed Changed||
Raised when this XObject or any of its descendants have changed.(Inherited from XObject)
|Changing Changing Changing Changing||
Raised when this XObject or any of its descendants are about to change.(Inherited from XObject)
Explicit Interface Implementations
|IXmlLineInfo.HasLineInfo() IXmlLineInfo.HasLineInfo() IXmlLineInfo.HasLineInfo() IXmlLineInfo.HasLineInfo()||
Gets a value indicating whether or not this XObject has line information.(Inherited from XObject)
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.