XElement.Attribute Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns the XAttribute of this XElement that has the specified XName.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Parameters
- name
- Type: System.Xml.Linq.XName
The XName of the XAttribute to get.
Return Value
Type: System.Xml.Linq.XAttributeAn XAttribute that has the specified XName; Nothing if there is no attribute with the specified name.
Some axis methods return collections of elements or attributes. This method returns only a single attribute. Sometimes this is referred to as a singleton (in contrast to a collection).
Visual Basic users can use the integrated attribute axis to retrieve the value of an attribute with a specified name.