Export (0) Print
Expand All

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)

public XAttribute Attribute(
	XName name
)

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; null 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:
© 2014 Microsoft