Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Attribute Method

XElement.Attribute Method

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.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft