当前位置: 代码迷 >> .NET Framework >> c#如何操作xml
  详细解决方案

c#如何操作xml

热度:101   发布时间:2016-05-02 00:39:24.0
c#怎么操作xml
XML文件格式如下:
<?xml version='1.0' encoding='UTF-8'?>
<feed >
  <entry>
  <id>http://gdata.youtube.com/feeds/api/videos/bcMUC-SI3_0</id>
  <app:control>
  <app:draft>yes</app:draft>
  </app:control>
  <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='2分钟剧场版'/>
  <title type='text'>铁达时 Time Is Love 2010电视广告 2分钟剧场版</title>
  <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=bcMUC-SI3_0&amp;feature=youtube_gdata'/>
  <author>
  <name>dyqx71</name>
  <uri>http://gdata.youtube.com/feeds/api/users/dyqx71</uri>
  </author>
  <gd:comments>
  <gd:feedLink href='http://gdata.youtube.com/feeds/api/videos/bcMUC-SI3_0/comments' countHint='0'/>
  </gd:comments>
  <media:group>
  <media:category label='People &amp; Blogs' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>People</media:category>
  <media:content url='rtsp://v7.cache7.c.youtube.com/CigLENy73wIaHwn934jkCxTDbRMYESARFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='121' yt:format='6'/>
  <media:thumbnail url='http://i.ytimg.com/vi/bcMUC-SI3_0/0.jpg' height='360' width='480' time='00:01:00.500'/>
  <media:title type='plain'>铁达时 Time Is Love 2010电视广告 2分钟剧场版</media:title>
  <yt:duration seconds='121'/>
  </media:group>
  <yt:statistics favoriteCount='0' viewCount='1'/>
  </entry>
</feed>

用c#应该怎么获得entry节点下的值,例如id,author节点下的name值,media:group节点下的media:content的url值??
谢谢网友们。

------解决方案--------------------
通过<feel>节点,一级一级往下面找子节点
获得某一个节点的方法
selectSinglenode("feel/entry/id")
  相关解决方案