无法从此xml中查询每个元素。我得去拿头衔,身份证, http://gdata.youtube.com/feeds/api/videos 2010-08-24T13:18:29.767Z YouTube视频匹配查询:aa http://www.youtube.com/img/pic_youtubelogo_123x63.gif YouTube http://www.youtube.com/ YouTube数据API 484223 1. 25 http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c 2007-12-30T23:11:39.000Z 2010-08-24T02:30:36.000Z AA-12。世界上最致命的猎枪! 网站链接:tinyurl.com黑水枪械:www.blackwaterusa.com MFS357http://gdata.youtube.com/feeds/api/users/mfs357Techweblink: tinyurl.com黑水枪械:www.blackwaterusa.comAA-12,AA,12,AA12,自动,猎枪,武器,武器,军事,硬件,突击,黑水,枪械,陆军,Americana-12。世界上最致命的猎枪!

无法从此xml中查询每个元素。我得去拿头衔,身份证, http://gdata.youtube.com/feeds/api/videos 2010-08-24T13:18:29.767Z YouTube视频匹配查询:aa http://www.youtube.com/img/pic_youtubelogo_123x63.gif YouTube http://www.youtube.com/ YouTube数据API 484223 1. 25 http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c 2007-12-30T23:11:39.000Z 2010-08-24T02:30:36.000Z AA-12。世界上最致命的猎枪! 网站链接:tinyurl.com黑水枪械:www.blackwaterusa.com MFS357http://gdata.youtube.com/feeds/api/users/mfs357Techweblink: tinyurl.com黑水枪械:www.blackwaterusa.comAA-12,AA,12,AA12,自动,猎枪,武器,武器,军事,硬件,突击,黑水,枪械,陆军,Americana-12。世界上最致命的猎枪!,xml,apache-flex,flash,actionscript-3,Xml,Apache Flex,Flash,Actionscript 3,需要从此xml获取标题、id和其他内部值,尝试使用xml.feed.title和其他选项…xml变量引用根标记本身。因此,您不必在e4x中引用提要 <?xml version='1.0' encoding='UTF-8'?> <feed > <id>http://gdata.youtube.com/feeds/api/videos</id> <updated>2010-08-24T13:18:29.767Z</updated>

需要从此xml获取标题、id和其他内部值,尝试使用xml.feed.title和其他选项…

xml变量引用根标记本身。因此,您不必在e4x中引用
提要

<?xml version='1.0' encoding='UTF-8'?>
<feed >
<id>http://gdata.youtube.com/feeds/api/videos</id>
<updated>2010-08-24T13:18:29.767Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<title type='text'>YouTube Videos matching query: aa</title>
<logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
<link rel='alternate' type='text/html' href='http://www.youtube.com'/>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos'/>
<link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/batch'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos?q=aa&amp;start-index=1&amp;max-results=25'/>
<link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos?q=aa&amp;start-index=26&amp;max-results=25'/>

<author>
    <name>YouTube</name>
 <uri>http://www.youtube.com/</uri>
</author>


<generator version='2.0' uri='http://gdata.youtube.com/'>YouTube data API</generator>


<openSearch:totalResults>484223</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>

<openSearch:itemsPerPage>25</openSearch:itemsPerPage>

<entry>

 <id>http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c</id>

 <published>2007-12-30T23:11:39.000Z</published>

 <updated>2010-08-24T02:30:36.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='Tech' label='Science &amp; Technology'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='AA-12'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='AA'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='12'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='AA12'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='automatic'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='shotgun'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='weapon'/>

 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='weapons'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='military'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='hardware'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='assault'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='blackwater'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='firearms'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='army'/>
 <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='american'/>

 <title type='text'>AA-12. World's deadliest shotgun!</title>


 <content type='text'>weblink: tinyurl.com Blackwater firearms: www.blackwaterusa.com</content>

 <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=p4ebtj1jR7c&amp;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/p4ebtj1jR7c/responses'/>
 <link rel='http://gdata.youtube.com/schemas/2007#video.ratings' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c/ratings'/>
 <link rel='http://gdata.youtube.com/schemas/2007#video.complaints' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c/complaints'/>
 <link rel='http://gdata.youtube.com/schemas/2007#video.related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c/related'/>
 <link rel='http://gdata.youtube.com/schemas/2007#mobile' type='text/html' href='http://m.youtube.com/details?v=p4ebtj1jR7c'/>
 <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c'/>


 <author><name>MFS357</name><uri>http://gdata.youtube.com/feeds/api/users/mfs357</uri></author><gd:comments><gd:feedLink href='http://gdata.youtube.com/feeds/api/videos/p4ebtj1jR7c/comments' countHint='15208'/></gd:comments><media:group><media:category label='Science &amp; Technology' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Tech</media:category><media:content url='http://www.youtube.com/v/p4ebtj1jR7c?f=videos&amp;d=ARZEzGI7ejBt-fukjjc3kIAO88HsQjpE1a8d1GxQnGDm&amp;app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='384' yt:format='5'/><media:content url='rtsp://v3.cache3.c.youtube.com/CkULENy73wIaPAm3R2M9tpuHpxMYDSANFEgGUgZ2aWRlb3NyIQEWRMxiO3owbfn7pI43N5CADvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='384' yt:format='1'/><media:content url='rtsp://v4.cache8.c.youtube.com/CkULENy73wIaPAm3R2M9tpuHpxMYESARFEgGUgZ2aWRlb3NyIQEWRMxiO3owbfn7pI43N5CADvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='384' yt:format='6'/><media:description type='plain'>weblink: tinyurl.com Blackwater firearms: www.blackwaterusa.com</media:description><media:keywords>AA-12, AA, 12, AA12, automatic, shotgun, weapon, weapons, military, hardware, assault, blackwater, firearms, army, american</media:keywords><media:player url='http://www.youtube.com/watch?v=p4ebtj1jR7c&amp;feature=youtube_gdata_player'/><media:thumbnail url='http://i.ytimg.com/vi/p4ebtj1jR7c/2.jpg' height='90' width='120' time='00:03:12'/><media:thumbnail url='http://i.ytimg.com/vi/p4ebtj1jR7c/1.jpg' height='90' width='120' time='00:01:36'/><media:thumbnail url='http://i.ytimg.com/vi/p4ebtj1jR7c/3.jpg' height='90' width='120' time='00:04:48'/><media:thumbnail url='http://i.ytimg.com/vi/p4ebtj1jR7c/0.jpg' height='240' width='320' time='00:03:12'/><media:title type='plain'>AA-12. World's deadliest shotgun!</media:title><yt:duration seconds='384'/></media:group><gd:rating average='4.774384' max='5' min='1' numRaters='12180' rel='http://schemas.google.com/g/2005#overall'/><yt:statistics favoriteCount='27463' viewCount='7607670'/></entry></feed>

xml似乎使用了一些名称空间,如
openSearch
gd
等,但它们的声明不存在。

对于每个视频条目,您可以这样做:

var feed:XML = new XML(theString);
trace(feed.entry.title);
trace(feed.entry.id);
trace(feed.entry.author.name);
xml.entry[index] //this will give you the XMLList for 'index' numbered video
xml.entry[index].title 
xml.entry[index].id  //these will give you title and id for corresponding videos