System.Xml.XmlReader.GetAttribute Method

When overridden in a derived class, gets the value of the attribute with the specified index.

Syntax

public abstract string GetAttribute (int i)

Parameters

i
The index of the attribute. The index is zero-based. (The first attribute has index 0.)

Returns

The value of the specified attribute. This method does not move the reader.

Exceptions

TypeReason
ArgumentOutOfRangeException i is less than 0, or greater than or equal to the XmlReader.AttributeCount of the containing element.

Remarks

Operation
This method does not move the reader.

Note to Inheritors
This method must be overridden in order to provide the functionality described above, as there is no default implementation.

Example

For an example demonstrating this method, see XmlTextReader.GetAttribute(int)(string, string).

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0