Returns the value of an attribute in a start tag.
[Visual Basic] Overloads Public Function GetAttr( _ ByVal id As XmlIdent _ ) As String [C#] public string GetAttr( XmlIdent id ); [C++] public: String* GetAttr( XmlIdent* id ); [JScript] public function GetAttr( id : XmlIdent ) : String;
The value of the attribute, or null if the reader is not positioned on a start tag or if the start tag does not contain an attribute with the given identifer.
Exception Type | Condition |
---|---|
ArgumentException | If id is null or does not belong to the same XML context as this reader. |
When the reader is positioned on a start tag, this method can be used to obtain the value of a given attribute. The return value is null if the reader is not positioned on a start tag or if the start tag does not contain an attribute with the given identifier.
To obtain the identifier and value of each attribute of a start tag, use the ReadAttr method.
XmlReader Class | XmlReader Members | System.Xml Namespace | XmlReader.GetAttr Overload List | GetAttr | GetAttr | ReadAttr