请问怎么做到像CSDN提问页面一样,HTTP显示的是以XML结尾的,是怎么读出来的呢?

解决方案 »

  1.   

    请问怎么做到像CSDN提问页面一样,HTTP显示的是以XML结尾的,是怎么读出来的呢?
      

  2.   

    有一个xls样式文件去解析格式
      

  3.   

    你看一下这一页的源码:
    ------------------------
    <?xml version="1.0" encoding="GB2312"?>
    <?xml-stylesheet type='text/xsl' href='/expert/Xsl/2.xsl'?>
    <Topic>
    <Issue>
    <PostUserNickName>fsarqeq</PostUserNickName>
    <rank>一级(初级)</rank>
    <ranknum>user1</ranknum>
    <credit>        70</credit>
    <TopicId>   4289576</TopicId>
    <TopicName>xml生成页面</TopicName>
    <PostUserId>862498</PostUserId>
    <PostUserName>y2jwww</PostUserName>
    <RoomName>.NET技术 C#</RoomName>
    <ReplyNum>3</ReplyNum>
    <PostDateTime>2005-09-23 14:37:18</PostDateTime>
    <Point>20</Point>
    <ReadNum>0</ReadNum>
    <RoomId>5201</RoomId>
    <EndState>0</EndState>
    <Content>请问怎么做到像CSDN提问页面一样,HTTP显示的是以XML结尾的,是怎么读出来的呢?</Content>
    </Issue>
    <Replys>
    <Reply>
    <PostUserNickName>fsarqeq</PostUserNickName>
    <rank>一级(初级)</rank>
    <ranknum>user1</ranknum>
    <credit>70</credit>
    <ReplyID>31568223</ReplyID>
    <TopicID>4289576</TopicID>
    <PostUserId>862498</PostUserId>
    <PostUserName>y2jwww</PostUserName>
    <Point>0</Point>
    <Content>请问怎么做到像CSDN提问页面一样,HTTP显示的是以XML结尾的,是怎么读出来的呢?</Content>
    <PostDateTime>2005-09-23 15:28:00</PostDateTime>
    </Reply><Reply>
    <PostUserNickName>坚决抵制日货</PostUserNickName><rank>一级(初级)</rank><ranknum>user1</ranknum><credit>100</credit><ReplyID>31568613</ReplyID><TopicID>4289576</TopicID><PostUserId>932241</PostUserId><PostUserName>sukyboor</PostUserName><Point>0</Point><Content>有一个xls样式文件去解析格式</Content><PostDateTime>2005-09-23 15:42:00</PostDateTime>
    </Reply><Reply><PostUserNickName>fsarqeq</PostUserNickName><rank>一级(初级)</rank><ranknum>user1</ranknum><credit>70</credit><ReplyID>31569044</ReplyID><TopicID>4289576</TopicID><PostUserId>862498</PostUserId><PostUserName>y2jwww</PostUserName><Point>0</Point><Content>可以写一下吗?</Content><PostDateTime>2005-09-23 15:58:00</PostDateTime>
    </Reply></Replys>
    </Topic>
      

  4.   

    比如这个页面:
    http://community.csdn.net/Expert/topic/4289/4289576.xml?temp=.3029138
    它的样式是:
    http://community.csdn.net/Expert/Xsl/2.xsl
    你分析一下就可以了
      

  5.   

    还有个典型的例子就是MSN的聊天记录