以下是我对一个xml文件进行的排序代码:可是虽然编译没有错,但是不执行啊 !哪位大哥知道是怎么回师,
如何修改???
StringBuilder sorted = new StringBuilder();
XmlDocument xdoc=new XmlDocument();
xdoc.Load("login.xml");
XPathNavigator nav=xdoc.CreateNavigator();
XPathExpression exp=nav.Compile("/server/sever");
exp.AddSort("score",XmlSortOrder.Descending,XmlCaseOrder.None,"",XmlDataType.Text);
XPathNodeIterator iter=nav.Select(exp);
while(iter.MoveNext())
{
XPathNavigator copy=iter.Current.Clone();
//write the size child node
copy.MoveToFirstChild();
copy.MoveToNext();
copy.MoveToNext();
}
xdoc.Save("login.xml");