Returns the value of an attribute in a start tag.
[Visual Basic] Overloads Public Function GetAttr( _ ByVal name As String _ ) As String [C#] public string GetAttr( string name ); [C++] public: String* GetAttr( String* name ); [JScript] public function GetAttr( name : String ) : 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 name.
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 name.
This method examines only per-element attributes (attributes with no namespace prefix). To obtain the value of a global attribute, use the GetAttr or GetAttr method.
When multiple calls are made to this method with the same argument, it is more efficient to obtain an XmlIdent once and then repeatedly call the GetAttr method for that 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