views:

29

answers:

2
<?xml version='1.0' encoding='UTF-8'?>
<feed >
<id>http://gdata.youtube.com/feeds/api/videos&lt;/id&gt;
<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'/&gt;
<title type='text'>YouTube Videos matching query: aa</title>
<logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif&lt;/logo&gt;
<link rel='alternate' type='text/html' href='http://www.youtube.com'/&gt;
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos'/&gt;
<link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/batch'/&gt;
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos?q=aa&amp;amp;start-index=1&amp;amp;max-results=25'/&gt;
<link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos?q=aa&amp;amp;start-index=26&amp;amp;max-results=25'/&gt;

<author>
    <name>YouTube</name>
 <uri>http://www.youtube.com/&lt;/uri&gt;
</author>


<generator version='2.0' uri='http://gdata.youtube.com/'&gt;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&lt;/id&gt;

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


 <author><name>MFS357</name><uri>http://gdata.youtube.com/feeds/api/users/mfs357&lt;/uri&gt;&lt;/author&gt;&lt;gd:comments&gt;&lt;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'&gt;Tech&lt;/media:category&gt;&lt;media:content url='http://www.youtube.com/v/p4ebtj1jR7c?f=videos&amp;amp;d=ARZEzGI7ejBt-fukjjc3kIAO88HsQjpE1a8d1GxQnGDm&amp;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;amp;feature=youtube_gdata_player'/&gt;&lt;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'/&gt;&lt;yt:statistics favoriteCount='27463' viewCount='7607670'/></entry></feed>

need to fetch title,id and other inner values from this xml, tried as xml.feed.title and other options to...

+1  A: 

The xml variable refers to the root tag itself. So you needn't refer to feed in your e4x.

var feed:XML = new XML(theString);
trace(feed.entry.title);
trace(feed.entry.id);
trace(feed.entry.author.name);

It looks like the xml uses some namespaces like openSearch, gd etc, but their declarations are not present.

Amarghosh
A: 

For each video entry you can go like this:

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 

bhups