Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I access xml nodes with out namespaces?
    primarykey
    data
    text
    <p>I've been banging my head on my desk for hours trying to figure out why I can't access the entry.author.name content? I've tried every possible way to access it but failed. </p> <p>But when I loop through all nodes with xml.children I see the author node. </p> <p>I see the author node is apart of the atom namespace but it doesn't have a namespace like the other namespaces.</p> <p><pre> package { import flash.display.Sprite;</p> <code>public class Gdata extends Sprite { private var xml:XML = &lt;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"&gt; http://www.w3.org/2005/Atom,http://search.yahoo.com/mrss/,http://schemas.google.com/g/2005, http://gdata.youtube.com/schemas/2007 &lt;id&gt; http://gdata.youtube.com/feeds/api/videos/bwbZJw-C4Jk &lt;/id&gt; &lt;published&gt; 2009-04-17T19:11:48.000Z &lt;/published&gt; &lt;updated&gt; 2009-04-29T10:19:50.000Z &lt;/updated&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="News" label="News &amp; Politics"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Garofalo"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Olbermann"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="commentary"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Janeane"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="news"/&gt; &lt;category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Keith"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="analysis"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Party"/&gt; &lt;category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Tea"/&gt; &lt;title type="text"&gt; Janeane Garofalo Calls Tea Party Protesters Racists &lt;/title&gt; &lt;content type="text"&gt; Janeane Garofalo: http://tinyurl.com/cr6rt8 EPA: http://tinyurl.com/clpyqo Veterans: http://tinyurl.com/ckbhb6 DHS: http://tinyurl.com/cctf54 DHS2: http://tinyurl.com/dahaxr John Ziegler: http://tinyurl.com/d7qbo4 Teabagging: http://tinyurl.com/ddskjo &lt;/content&gt; &lt;link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=bwbZJw-C4Jk"/&gt; &lt;link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/bwbZJw-C4Jk/responses"/&gt; &lt;link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/bwbZJw-C4Jk/related"/&gt; &lt;link rel="http://gdata.youtube.com/schemas/2007#mobile" type="text/html" href="http://m.youtube.com/details?v=bwbZJw-C4Jk"/&gt; &lt;link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/bwbZJw-C4Jk"/&gt; &lt;author&gt; &lt;name&gt; HowTheWorldWorks &lt;/name&gt; &lt;uri&gt; http://gdata.youtube.com/feeds/api/users/howtheworldworks &lt;/uri&gt; &lt;/author&gt; &lt;gd:comments&gt; &lt;gd:feedLink href="http://gdata.youtube.com/feeds/api/videos/bwbZJw-C4Jk/comments" countHint="2249"/&gt; &lt;/gd:comments&gt; &lt;media:group&gt; &lt;media:category label="News &amp; Politics" scheme="http://gdata.youtube.com/schemas/2007/categories.cat"&gt; News &lt;/media:category&gt; &lt;media:content url="http://www.youtube.com/v/bwbZJw-C4Jk&amp;f=videos&amp;app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isDefault="true" expression="full" duration="236" yt:format="5"/&gt; &lt;media:content url="rtsp://rtsp2.youtube.com/CiILENy73wIaGQmZ4IIPJ9kGbxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="236" yt:format="1"/&gt; &lt;media:content url="rtsp://rtsp2.youtube.com/CiILENy73wIaGQmZ4IIPJ9kGbxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="236" yt:format="6"/&gt; &lt;media:description type="plain"&gt; Janeane Garofalo: http://tinyurl.com/cr6rt8 &lt;/media:description&gt; &lt;media:keywords&gt; Janeane, Garofalo, Keith, Olbermann, Tea, Party, commentary, analysis, news &lt;/media:keywords&gt; &lt;media:player url="http://www.youtube.com/watch?v=bwbZJw-C4Jk"/&gt; &lt;media:thumbnail url="http://i.ytimg.com/vi/bwbZJw-C4Jk/default.jpg" height="90" width="120" time="00:01:58"/&gt; &lt;media:thumbnail url="http://i.ytimg.com/vi/bwbZJw-C4Jk/1.jpg" height="90" width="120" time="00:00:59"/&gt; &lt;media:thumbnail url="http://i.ytimg.com/vi/bwbZJw-C4Jk/3.jpg" height="90" width="120" time="00:02:57"/&gt; &lt;media:thumbnail url="http://i.ytimg.com/vi/bwbZJw-C4Jk/0.jpg" height="240" width="320" time="00:01:58"/&gt; &lt;media:title type="plain"&gt; Janeane Garofalo Calls Tea Party Protesters Racists &lt;/media:title&gt; &lt;yt:duration seconds="236"/&gt; &lt;/media:group&gt; &lt;gd:rating average="3.9231105" max="5" min="1" numRaters="2289" rel="http://schemas.google.com/g/2005#overall"/&gt; &lt;yt:statistics favoriteCount="304" viewCount="33463"/&gt; &lt;/entry&gt;; namespace atom = "http://www.w3.org/2005/Atom" namespace media ="http://search.yahoo.com/mrss/"; namespace gd = "http://schemas.google.com/g/2005"; namespace yt = "http://gdata.youtube.com/schemas/2007"; public function Gdata() { var atom:Namespace = new Namespace(); trace("0",xml.children()[22]); trace("1",xml.inScopeNamespaces()); trace("2",xml..media::group); trace("3",xml..yt::statistics.@favoriteCount); trace("4",xml..yt::duration.@seconds); trace("5",xml..author ); // why????????? trace("6",xml.author ); // why????????? var x:int = 0; for each (var i in xml.children()) { if(i.localName() == 'author') { trace("author", i); } } } } </code></pre> <p>}</p> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload