Attribute Method

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.

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

'Declaration
Public Function Attribute ( _
	name As XName _
) As XAttribute

Parameters

name
Type: System.Xml.Linq.XName
The XName of the XAttribute to get.

Return Value

Type: System.Xml.Linq.XAttribute
An 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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft