Indicates whether any attributes are available to read.
[Visual Basic] Public ReadOnly Property HasAttr As Boolean [C#] public bool HasAttr {get;} [C++] public: __property bool get_HasAttr(); [JScript] public function get HasAttr() : Boolean;
This property is true if the reader is positioned on a start tag that includes attributes and if one or more of those attributes have not yet been read.
The HasAttr property is typically used in a loop of the form:
while (reader.HasAttr) { XmlAttribute a = reader.ReadAttr(); Console.WriteLine("{0}='{1}'", a.ID, a.Value); }
The HasAttr property is updated when the reader is advanced to the next XML node or when an attribute is read using the ReadAttr method.
There is no requirement that all attributes be read before a reader can be advanced to the next XML node.
XmlReader Class | XmlReader Members | System.Xml Namespace | ReadAttr