The XmlReader class provides various methods and properties for reading attributes. Attributes are most commonly found on elements. However, they are also allowed on XML declaration and document type nodes.
When positioned on an element node, the MoveToAttribute methods enable you to go through the attribute list of the element. After MoveToAttribute has been called, the node properties—such as Name, NamespaceURI, Prefix, and so on—reflect the properties of that attribute, and not the containing element it belongs to.
Liked By
Write Answer
How do we access attributes using “XmlReader”?
Join MindStick Community
You have need login or register for voting of answers or question.
Vijay Shukla
02-Apr-2013The XmlReader class provides various methods and properties for reading attributes. Attributes are most commonly found on elements. However, they are also allowed on XML declaration and document type nodes.
When positioned on an element node, the MoveToAttribute methods enable you to go through the attribute list of the element. After MoveToAttribute has been called, the node properties—such as Name, NamespaceURI, Prefix, and so on—reflect the properties of that attribute, and not the containing element it belongs to.