public abstract MoveToNextAttribute ( ) : bool | ||
return | bool |
XPathNavigator navigator = document.CreateNavigator(); if (navigator.MoveToFirstAttribute()) { do { Console.WriteLine(navigator.Name + "=" + navigator.Value); } while (navigator.MoveToNextAttribute()); }
XPathNodeIterator iterator = navigator.Select("/bookstore/book"); while (iterator.MoveNext()) { if (iterator.Current.MoveToFirstAttribute()) { do { Console.WriteLine(iterator.Current.Value); } while (iterator.Current.MoveToNextAttribute()); } }Package Library: System.Xml.XPath is the package library that contains the XPathNavigator.MoveToNextAttribute method. This namespace provides classes for processing XPath expressions and navigating XML documents using XPath queries.