Creates a new XAttribute with the given name and an empty-string value.
The qualified name of the attribute.
Accepts either a name and value, a name alone (empty-string value), or an existing XAttribute to copy.
Creates a new XAttribute with the given name and value.
The qualified name of the attribute.
The value, converted to a string via toString().
Creates a new XAttribute by copying an existing one.
The attribute to copy.
ReadonlynameThe fully-qualified name of this attribute.
The string value of this attribute.
The kind of XML node this object represents.
The parent of this object in the XML tree, or null if it is a root.
Returns the next sibling attribute on the parent element, or null.
Returns the previous sibling attribute on the parent element, or null.
Compares this attribute to another by name and value.
The attribute to compare against.
true if both name and value are equal.
Returns the XML serialization of this attribute, e.g. name='value'.
The serialized attribute string with XML-escaped value.
Removes annotations from this object.
Represents an XML attribute on an element.
Remarks
Attributes are not nodes in the XNode sense -- they do not appear in XContainer.nodes | nodes() or descendants() results -- but they inherit from XObject and carry the same parent reference and annotation API.
Example