static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("5361");
XPathNavigator nav = doc.CreateNavigator();
string path = "/a/b";
XPathExpression expression = nav.Compile(path);
expression.AddSort("text()", XmlSortOrder.Ascending, XmlCaseOrder.None, string.Empty, XmlDataType.Number);
XPathNodeIterator iterator = nav.Select(expression);
while (iterator.MoveNext())
{
Console.WriteLine(iterator.Current.Value);
}
}
No comments:
Post a Comment