<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Reading XML with PHP</title>
	<atom:link href="http://fuelyourcoding.com/reading-xml-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://fuelyourcoding.com/reading-xml-with-php/</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 16:57:58 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jacobain</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-5630</link>
		<dc:creator>Jacobain</dc:creator>
		<pubDate>Wed, 30 Nov 2011 10:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-5630</guid>
		<description>Thank you for fueling my coding... This tutorial finally gave me an insight.</description>
		<content:encoded><![CDATA[<p>Thank you for fueling my coding&#8230; This tutorial finally gave me an insight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Foxy</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-5568</link>
		<dc:creator>Foxy</dc:creator>
		<pubDate>Sun, 02 Oct 2011 21:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-5568</guid>
		<description>Wow, this was a great tutorial.  I tried using DOM objects and all sorts of &quot;simple&quot; php xml functions before your tutorial that all didn&#039;t work.  this was exactly what I needed!  THANK YOU!  :)</description>
		<content:encoded><![CDATA[<p>Wow, this was a great tutorial.  I tried using DOM objects and all sorts of &#8220;simple&#8221; php xml functions before your tutorial that all didn&#8217;t work.  this was exactly what I needed!  THANK YOU!  :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Weng</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-5366</link>
		<dc:creator>Weng</dc:creator>
		<pubDate>Mon, 15 Aug 2011 19:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-5366</guid>
		<description>Too complicated!

Shouldn&#039;t have relied on an example with Last.fm. Use a simpler XML file.</description>
		<content:encoded><![CDATA[<p>Too complicated!</p>
<p>Shouldn&#8217;t have relied on an example with Last.fm. Use a simpler XML file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-4912</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Fri, 04 Mar 2011 17:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-4912</guid>
		<description>I get an error with this code. How disappointing! :-(
Parse error: syntax error, unexpected &#039;@&#039;, expecting &#039;,&#039; or &#039;;&#039;</description>
		<content:encoded><![CDATA[<p>I get an error with this code. How disappointing! :-(<br />
Parse error: syntax error, unexpected &#8216;@&#8217;, expecting &#8216;,&#8217; or &#8216;;&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wedphp</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-403</link>
		<dc:creator>wedphp</dc:creator>
		<pubDate>Fri, 17 Jul 2009 10:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-403</guid>
		<description>Hi
i used this script .but there is error
Fatal error: Call to a member function attributes() on a non-object in D:\xampp\htdocs\xml.php on line 9</description>
		<content:encoded><![CDATA[<p>Hi<br />
i used this script .but there is error<br />
Fatal error: Call to a member function attributes() on a non-object in D:\xampp\htdocs\xml.php on line 9</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Owens</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-318</link>
		<dc:creator>Michael Owens</dc:creator>
		<pubDate>Sat, 20 Jun 2009 19:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-318</guid>
		<description>An alternative (and much more versatile) method of managing and parsing XML data is using the DOMDocument class ( The class details can be found at http://us3.php.net/manual/en/class.domdocument.php ).

For simple XML work, the simplexml method as the name &quot;simplexml&quot; implies, but it does not allow for any actual manipulation of the XML DOM (upon which many advanced interactions between PHP and XML rely) and it actually makes working with XML namespaces (like the Dublin Core, API-specific Namespaces, and any other custom namespaces that a data provider might use).</description>
		<content:encoded><![CDATA[<p>An alternative (and much more versatile) method of managing and parsing XML data is using the DOMDocument class ( The class details can be found at <a href="http://us3.php.net/manual/en/class.domdocument.php" rel="nofollow">http://us3.php.net/manual/en/class.domdocument.php</a> ).</p>
<p>For simple XML work, the simplexml method as the name &#8220;simplexml&#8221; implies, but it does not allow for any actual manipulation of the XML DOM (upon which many advanced interactions between PHP and XML rely) and it actually makes working with XML namespaces (like the Dublin Core, API-specific Namespaces, and any other custom namespaces that a data provider might use).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-270</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Tue, 16 Jun 2009 04:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-270</guid>
		<description>Decent tutorial for beginners; might want to clean up your code next time though. ;)

You should also do this:
$feed = &#039;http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&amp;user=YourName&amp;api_key=&#039;;
	$local = &#039;YourName.xml&#039;;
	if( (!file_exists($local)) &#124;&#124; (time() - filemtime($local) &gt; 120) )
	{
		$contents = file_get_contents($feed);
		$fp = fopen($local, &quot;w&quot;);
		fwrite($fp, $contents);
		fclose($fp);
	}
	$xml = simplexml_load_file($local);

Makes a local cache of the XML file every two minutes. This really improves the page load time.</description>
		<content:encoded><![CDATA[<p>Decent tutorial for beginners; might want to clean up your code next time though. ;)</p>
<p>You should also do this:<br />
$feed = &#8216;http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&amp;user=YourName&amp;api_key=&#8217;;<br />
	$local = &#8216;YourName.xml&#8217;;<br />
	if( (!file_exists($local)) || (time() &#8211; filemtime($local) &gt; 120) )<br />
	{<br />
		$contents = file_get_contents($feed);<br />
		$fp = fopen($local, &#8220;w&#8221;);<br />
		fwrite($fp, $contents);<br />
		fclose($fp);<br />
	}<br />
	$xml = simplexml_load_file($local);</p>
<p>Makes a local cache of the XML file every two minutes. This really improves the page load time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaya Kessler</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-206</link>
		<dc:creator>Gaya Kessler</dc:creator>
		<pubDate>Fri, 12 Jun 2009 15:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-206</guid>
		<description>There are some SimpleXML classes available for PHP &lt; 5, most of them are quite good copies.</description>
		<content:encoded><![CDATA[<p>There are some SimpleXML classes available for PHP < 5, most of them are quite good copies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mohammed</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-205</link>
		<dc:creator>mohammed</dc:creator>
		<pubDate>Fri, 12 Jun 2009 06:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-205</guid>
		<description>How we pass the xml in php 4.3.9</description>
		<content:encoded><![CDATA[<p>How we pass the xml in php 4.3.9</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Kinsella</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-85</link>
		<dc:creator>Dave Kinsella</dc:creator>
		<pubDate>Thu, 28 May 2009 15:00:55 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-85</guid>
		<description>Just as an additional note, something I worked out for myself whilst processing xml responses from the basecamp api: 

If an xml element name contains reserved characters (in this case, a hyphen), you need to add curly braces around the item name e.g.

$lists = simplexml_load_string($response-&gt;data);
foreach($lists-&gt;{todo-list} as $list){
        $this-&gt;TodosComplete = $this-&gt;TodosComplete + $list-&gt;{completed-count};
        $this-&gt;TodosIncomplete = $this-&gt;TodosIncomplete + $list-&gt;{uncompleted-count};
}</description>
		<content:encoded><![CDATA[<p>Just as an additional note, something I worked out for myself whilst processing xml responses from the basecamp api: </p>
<p>If an xml element name contains reserved characters (in this case, a hyphen), you need to add curly braces around the item name e.g.</p>
<p>$lists = simplexml_load_string($response->data);<br />
foreach($lists->{todo-list} as $list){<br />
        $this->TodosComplete = $this->TodosComplete + $list->{completed-count};<br />
        $this->TodosIncomplete = $this->TodosIncomplete + $list->{uncompleted-count};<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaya Kessler</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-33</link>
		<dc:creator>Gaya Kessler</dc:creator>
		<pubDate>Tue, 12 May 2009 10:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-33</guid>
		<description>Thanks for the comments guys!

@Wogan:
There is a way to output the XML again as a string: $xml-&gt;asXML(); will do this with the object we just made. Pretty easy and amazingly strong when adjusting the object!</description>
		<content:encoded><![CDATA[<p>Thanks for the comments guys!</p>
<p>@Wogan:<br />
There is a way to output the XML again as a string: $xml->asXML(); will do this with the object we just made. Pretty easy and amazingly strong when adjusting the object!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wogan</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-32</link>
		<dc:creator>Wogan</dc:creator>
		<pubDate>Tue, 12 May 2009 06:19:11 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-32</guid>
		<description>That&#039;s half the battle - finding out what these functions are called, heheh.

Nice going! Will &lt;b&gt;definitely&lt;/b&gt; be making use of it.

Btw, any functions around to re-encode a object as XML? Or is that the sole province of JSON?

~ Wogan</description>
		<content:encoded><![CDATA[<p>That&#8217;s half the battle &#8211; finding out what these functions are called, heheh.</p>
<p>Nice going! Will <b>definitely</b> be making use of it.</p>
<p>Btw, any functions around to re-encode a object as XML? Or is that the sole province of JSON?</p>
<p>~ Wogan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-31</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 12 May 2009 04:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-31</guid>
		<description>Yeah I learned about that a few months ago. Wish I knew about it the second 5 came out because it made life so easy.</description>
		<content:encoded><![CDATA[<p>Yeah I learned about that a few months ago. Wish I knew about it the second 5 came out because it made life so easy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaya Kessler</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-29</link>
		<dc:creator>Gaya Kessler</dc:creator>
		<pubDate>Mon, 11 May 2009 08:48:16 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-29</guid>
		<description>Thanks for the compliment Ethan.
My aim is to make articles as easy to understand as possible. I could go into ALL the details, but that wouldn&#039;t work.</description>
		<content:encoded><![CDATA[<p>Thanks for the compliment Ethan.<br />
My aim is to make articles as easy to understand as possible. I could go into ALL the details, but that wouldn&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ethan</title>
		<link>http://fuelyourcoding.com/reading-xml-with-php/comment-page-1/#comment-8</link>
		<dc:creator>Ethan</dc:creator>
		<pubDate>Fri, 08 May 2009 19:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://fuelyourcoding.com/?p=37#comment-8</guid>
		<description>This is the most useful tutorial on PHP parsing XML I&#039;ve ever seen. Nice and straight to the point.</description>
		<content:encoded><![CDATA[<p>This is the most useful tutorial on PHP parsing XML I&#8217;ve ever seen. Nice and straight to the point.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

