Returns the value of an attribute in a start tag.
[Visual Basic] Overloads Public Function GetAttr( _ ByVal name As String, _ ByVal ns As String _ ) As String [C#] public string GetAttr( string name, string ns ); [C++] public: String* GetAttr( String* name, String* ns ); [JScript] public function GetAttr( name : String, ns : 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 and namespace URI.
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 and namespace URI.
If the ns parameter is null or an empty string, the method examines only per-element attributes (attributes with no namespace prefix). Otherwise, the method examines those global attributes that have a prefix that resolves to the given namespace URI.
When multiple calls are made to this method with the same arguments, 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