I dont really understand the usage of "XmlReader.MoveToNextAttribute()". Because when i read about it in microsoft docs, it only return value true or false. And i don't understand why we should use "while loop" on it in this code :
if (reader.HasAttributes) {
Console.WriteLine("Attributes of <" + reader.Name + ">");
while (reader.MoveToNextAttribute()) {
Console.WriteLine(" {0}={1}", reader.Name, reader.Value);
}
}
Can anyone properly explain to me what is the real usage of "XmlReader.MoveToNextAttribute()" ?