YouTube リクエストからのレスポンスからタイトル ノードを抜き出そうとする単体テストを作成しました。xml は問題なく返されます。しかし、複数の異なるパスを試しても、タイトルを引き出すことができないようです。助けてくれてありがとう。
単体テスト
HttpClient client = new HttpClient();
Task<string> getStringTask = client.GetStringAsync("http://gdata.youtube.com/feeds/api/videos/t5QAfTGVxuo");
string urlContents = await getStringTask;
XmlDocument xml = new XmlDocument();
xml.LoadXml(urlContents);
XmlNodeList xnList = xml.SelectNodes("/entry/title");
リクエストの結果
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<id>http://gdata.youtube.com/feeds/api/videos/t5QAfTGVxuo</id>
<published>2010-07-08T03:08:21.000Z</published>
<updated>2013-05-11T12:01:32.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<category scheme='http://gdata.youtube.com/schemas/2007/categories.cat' term='Entertainment' label='Entertainment'/>
<title type='text'>Chelsea Lately: Pharrell</title>
<content type='text'>Pharrell chats about his latest animated film "Despicable Me." Plus, the hip-hop artist discusses his presidential friendships. Watch it!</content>
<link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=t5QAfTGVxuo&feature=youtube_gdata'/>
<link rel='http://gdata.youtube.com/schemas/2007#video.responses' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/t5QAfTGVxuo/responses'/>
<link rel='http://gdata.youtube.com/schemas/2007#video.related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/t5QAfTGVxuo/related'/>
<link rel='http://gdata.youtube.com/schemas/2007#mobile' type='text/html' href='http://m.youtube.com/details?v=t5QAfTGVxuo'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/t5QAfTGVxuo'/>
<author>
<name>ChelseaLately</name>
<uri>http://gdata.youtube.com/feeds/api/users/ChelseaLately</uri>
</author>
<gd:comments>
<gd:feedLink rel='http://gdata.youtube.com/schemas/2007#comments' href='http://gdata.youtube.com/feeds/api/videos/t5QAfTGVxuo/comments' countHint='1935'/>
</gd:comments>
<media:group>
<media:category label='Entertainment' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Entertainment</media:category>
<media:content url='http://www.youtube.com/v/t5QAfTGVxuo?version=3&f=videos&app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='375' yt:format='5'/>
<media:content url='rtsp://v8.cache4.c.youtube.com/CiILENy73wIaGQnqxpUxfQCUtxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='375' yt:format='1'/>
<media:content url='rtsp://v8.cache4.c.youtube.com/CiILENy73wIaGQnqxpUxfQCUtxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='375' yt:format='6'/>
<media:description type='plain'>Pharrell chats about his latest animated film "Despicable Me." Plus, the hip-hop artist discusses his presidential friendships. Watch it!</media:description>
<media:keywords/>
<media:player url='http://www.youtube.com/watch?v=t5QAfTGVxuo&feature=youtube_gdata_player'/>
<media:thumbnail url='http://i.ytimg.com/vi/t5QAfTGVxuo/0.jpg' height='360' width='480' time='00:03:07.500'/>
<media:thumbnail url='http://i.ytimg.com/vi/t5QAfTGVxuo/1.jpg' height='90' width='120' time='00:01:33.750'/>
<media:thumbnail url='http://i.ytimg.com/vi/t5QAfTGVxuo/2.jpg' height='90' width='120' time='00:03:07.500'/>
<media:thumbnail url='http://i.ytimg.com/vi/t5QAfTGVxuo/3.jpg' height='90' width='120' time='00:04:41.250'/>
<media:title type='plain'>Chelsea Lately: Pharrell</media:title>
<yt:duration seconds='375'/>
</media:group>
<gd:rating average='4.8778543' max='5' min='1' numRaters='3766' rel='http://schemas.google.com/g/2005#overall'/>
<yt:statistics favoriteCount='0' viewCount='1571771'/>
</entry>