<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: SimpleXML and namespaces</title>
	<atom:link href="http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Mon, 01 Dec 2008 19:01:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Tim</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-789491</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 31 Aug 2008 16:48:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-789491</guid>
		<description>Great article.  I have been trying to get a value from a node with a namespace for quite some time now and couldn't quite figure it out.

Thanks.</description>
		<content:encoded><![CDATA[<p>Great article.  I have been trying to get a value from a node with a namespace for quite some time now and couldn&#8217;t quite figure it out.</p>
<p>Thanks.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Crashdaddy</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-602137</link>
		<dc:creator>Crashdaddy</dc:creator>
		<pubDate>Sun, 13 Jan 2008 22:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-602137</guid>
		<description>That's definitely &lt;em&gt;dugg&lt;/em&gt;.  Thank you!</description>
		<content:encoded><![CDATA[<p>That&#8217;s definitely <em>dugg</em>.  Thank you!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: whatever</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-533595</link>
		<dc:creator>whatever</dc:creator>
		<pubDate>Mon, 03 Dec 2007 19:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-533595</guid>
		<description>is there a way to escape "" in xml file only. I want those characters to be recognized in html though.</description>
		<content:encoded><![CDATA[<p>is there a way to escape &#8220;&#8221; in xml file only. I want those characters to be recognized in html though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-431430</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 31 Oct 2007 20:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-431430</guid>
		<description>SimpleXML and namespaces are sooo gay. This should be handled the same as non-namespaced attributes.</description>
		<content:encoded><![CDATA[<p>SimpleXML and namespaces are sooo gay. This should be handled the same as non-namespaced attributes.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: greg bass</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-222008</link>
		<dc:creator>greg bass</dc:creator>
		<pubDate>Tue, 10 Apr 2007 17:53:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-222008</guid>
		<description>Kevin,
Thank you for this article.  I bought the book previously and this missing topic is just what I'm stuck on.  If you could indulge my ignorance, I am still stuck on how to parse multiple namespace items with multiple attributes on the same level. I am trying to parse the yahoo weather rss feed:

&#60;channel&#62;
...
  &#60;yweather:location city=&#34;Tombstone&#34; region=&#34;Arizona&#34; country=&#34;US&#34;&#62;&#60;yweather:location&#62;
...
  &#60;yweather:astronomy sunrise=&#34;7:02am&#34; sunset=&#34;4:51pm&#34;&#62;&#60;yweather:astronomy&#62;
...
&#60;channel&#62;

how do I get to sunrise for instance? $sunrise = ?
Thanks!</description>
		<content:encoded><![CDATA[<p>Kevin,<br />
Thank you for this article.  I bought the book previously and this missing topic is just what I&#8217;m stuck on.  If you could indulge my ignorance, I am still stuck on how to parse multiple namespace items with multiple attributes on the same level. I am trying to parse the yahoo weather rss feed:</p>
<p>&lt;channel&gt;<br />
&#8230;<br />
  &lt;yweather:location city=&quot;Tombstone&quot; region=&quot;Arizona&quot; country=&quot;US&quot;&gt;&lt;yweather:location&gt;<br />
&#8230;<br />
  &lt;yweather:astronomy sunrise=&quot;7:02am&quot; sunset=&quot;4:51pm&quot;&gt;&lt;yweather:astronomy&gt;<br />
&#8230;<br />
&lt;channel&gt;</p>
<p>how do I get to sunrise for instance? $sunrise = ?<br />
Thanks!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Yank</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-214032</link>
		<dc:creator>Kevin Yank</dc:creator>
		<pubDate>Thu, 29 Mar 2007 02:52:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-214032</guid>
		<description>Anonymous,

Sure -- just use the getNamespaces method: http://www.php.net/manual/en/function.simplexml-element-getNamespaces.php</description>
		<content:encoded><![CDATA[<p>Anonymous,</p>
<p>Sure &#8212; just use the getNamespaces method: <a href="http://www.php.net/manual/en/function.simplexml-element-getNamespaces.php" rel="nofollow">http://www.php.net/manual/en/function.simplexml-element-getNamespaces.php</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-213996</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 29 Mar 2007 01:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-213996</guid>
		<description>Is there any way to (automatically) get the xmlns:dc URL from the code?  I'd like to find the URI in code, but all examples have it hard-coded.</description>
		<content:encoded><![CDATA[<p>Is there any way to (automatically) get the xmlns:dc URL from the code?  I&#8217;d like to find the URI in code, but all examples have it hard-coded.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: joeblow</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-32030</link>
		<dc:creator>joeblow</dc:creator>
		<pubDate>Thu, 22 Jun 2006 19:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-32030</guid>
		<description>Is there any way to see what is contained in the buffer for $channel_itunes in the above example. I have tried the Zend debugger but is just states "Object of: SimpleXMLElement" and print_r gives me an empty SimpleXMLElement Object. If I could see the data that was contained in the buffer, I would be able to more accurately troubleshoot problems I was having without guessing as I am now.

Thanks.</description>
		<content:encoded><![CDATA[<p>Is there any way to see what is contained in the buffer for $channel_itunes in the above example. I have tried the Zend debugger but is just states &#8220;Object of: SimpleXMLElement&#8221; and print_r gives me an empty SimpleXMLElement Object. If I could see the data that was contained in the buffer, I would be able to more accurately troubleshoot problems I was having without guessing as I am now.</p>
<p>Thanks.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: joeblow</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-31716</link>
		<dc:creator>joeblow</dc:creator>
		<pubDate>Wed, 21 Jun 2006 15:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-31716</guid>
		<description>&#60;channel&#62;
    &#60;itunes:image href="some.link.com" type="video"&#62;
&#60;

I actually figured out the solution using your documentation and some experimentation.

foreach($rss-&#62;channel as $channel)
{
    $channel_itunes = $channel-&#62;children(’http://www.itunes.com/dtds/podcast-1.0.dtd’);
    $image_items = $channel_itunes-&#62;attributes();
    $image = $image_items['href'];
}</description>
		<content:encoded><![CDATA[<p>&lt;channel&gt;<br />
    &lt;itunes:image href=&#8221;some.link.com&#8221; type=&#8221;video&#8221;&gt;<br />
&lt;</p>
<p>I actually figured out the solution using your documentation and some experimentation.</p>
<p>foreach($rss-&gt;channel as $channel)<br />
{<br />
    $channel_itunes = $channel-&gt;children(’http://www.itunes.com/dtds/podcast-1.0.dtd’);<br />
    $image_items = $channel_itunes-&gt;attributes();<br />
    $image = $image_items[&#8217;href&#8217;];<br />
}</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Yank</title>
		<link>http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-31546</link>
		<dc:creator>Kevin Yank</dc:creator>
		<pubDate>Tue, 20 Jun 2006 23:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/#comment-31546</guid>
		<description>joeblow,

Could you post your code sample again and escape your special characters (e.g. &#38;lt;)?</description>
		<content:encoded><![CDATA[<p>joeblow,</p>
<p>Could you post your code sample again and escape your special characters (e.g. &amp;lt;)?</p>]]></content:encoded>
	</item>
</channel>
</rss>
