将XML文件读入到DATASET中,
排序,
得到前十条

解决方案 »

  1.   

    用 xsl 的话取 position() < 11 的
      

  2.   

    方法:
    先写个xsl进行排序,然后在进行输出参考http://dotnet.aspx.cc/ShowDetail.aspx?id=592D3BAD-C3DA-4217-2235-7D6AB7C62DB8
      

  3.   

    请问 xsl文件 和 xml文件 是什么关系?
      

  4.   

    XmlDocument doc=new XmlDocument();
    doc.Load(Server.MapPath("Xml/X_page/resourceinfo.xml"));
    XmlNodeList nd=doc.SelectNodes("/resourceinfo/XmlData[searcherlevel='1']");
    if(nd!=null)
    {
    for(int i=0;i<nd.Count&i<10;i++)
    {
    s_title=nd[i]["Titlename"].InnerText;
    s_name=s_title.Length>8?s_title.Substring(0,6)+"...":s_title;
    Label1.Text+="<br>· <a title='"+s_title+"' href=./A_Show.aspx?id="+nd[i]["topicid"].InnerText+",&Item="+nd[i]["XmlCode"].InnerText+">"+s_name+"</a><img src=images/gczj/new1.gif><br>"; }
    }
      

  5.   

    xsl相当于css,但是功能要强很多
    就是把xml输出成html的“语言”
      

  6.   

    不用,你可以使用Xpath函数,具体的你看看帮助
    选选出来的就是你要的结果,用nodes展开就是了