<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 23:30:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Christian Schaefer's Blog: Simply iterate over XML with plain PHP using little memory and CPU]]></title>
      <guid>http://www.phpdeveloper.org/news/16023</guid>
      <link>http://www.phpdeveloper.org/news/16023</link>
      <description><![CDATA[<p>
In <a href="http://test.ical.ly/2011/03/08/simply-iterate-over-xml-with-plain-php-using-little-memory-and-cpu/">a new post</a> to his Test.ical.ly blog <i>Christian Schaefer</i> shows you how to iterate over XML in a more efficient way with the help of the <a href="http://php.net/xmlreader">XMLReader</a> and Iterator features that come with PHP.
</p>
<blockquote>
One of the things I have been working on lately was a simple XML parser. It's a simple XML structure in my case though it could be more complex without much change. My solution was a quite powerful yet simple combination of XMLReader and the Iterator interface.
</blockquote>
<p>
He includes a sample XML document similar to the one he was working with and shows how XMLReader can handle it, keeping only the currently needed information in memory at one time. His sample class (CustomXml) loads the file and defines all of the iterator methods to work with the data like "next", "prev" and "rewind".
</p>]]></description>
      <pubDate>Thu, 10 Mar 2011 08:11:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: A Quick PHP XMLWriter Class Tutorial: XML & RSS]]></title>
      <guid>http://www.phpdeveloper.org/news/11765</guid>
      <link>http://www.phpdeveloper.org/news/11765</link>
      <description><![CDATA[<p>
The PHPBuilder.com has <a href="http://www.phpbuilder.com/columns/iceomnia_20090116.php3"a quick tutorial</a> posted today looking to introduce you to a powerful XML creation tool in PHP5 installations - <a href="http://php.net/xmlwriter">XMLWriter</a>.
</p>
<p>
They jump right in and show it in action by creating a simple RSS document with one element inside. A call to the flush() method on your XMLWriter object is all it takes to output the XML. 
</p>
<p>
They also change things up and bit and swap out the procedural code for a more object-oriented approach with a constructor that sets up the object and adds in some of the common RSS information. Their addItem() method is called to add in a sample item (in this case, an entry for a CD player product) and _endRSS() closes things off and runs that flush() to send it all back out.
</p>
<p>
You can find out more about XMLWriter (and its sister, <a href="http://us3.php.net/manual/en/book.xmlreader.php">XMLReader</a>) in <a href="http://us3.php.net/xmlwriter">the PHP manual</a>.
</p>]]></description>
      <pubDate>Mon, 19 Jan 2009 11:19:52 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jeremy Johnstone's Blog: PHP parser for OS X plist XML files]]></title>
      <guid>http://www.phpdeveloper.org/news/11291</guid>
      <link>http://www.phpdeveloper.org/news/11291</link>
      <description><![CDATA[<p>
<i>Jeremy Johnstone</i> has come up with a <a href="http://www.jeremyjohnstone.com/blog/archives/2008/10/26/php-parser-for-os-x-plist-xml-files/">simple plist xml parser</a>. The plist format is what iTunes (and some other application) uses for its library files.
</p>
<blockquote>
Normally SimpleXML is enough to handle most <a href="http://www.jeremyjohnstone.com/blog/archives/tag/xml/">XML</a> <a href="http://www.jeremyjohnstone.com/blog/archives/tag/parsing/">parsing</a> needs, but the <a href="http://www.jeremyjohnstone.com/blog/archives/tag/plist/">plist</a> <A href="http://www.jeremyjohnstone.com/blog/archives/tag/xml/">XML</a> format is just broken enough to make <a href="http://www.jeremyjohnstone.com/blog/archives/tag/parsing/">parsing</a> it with SimpleXML virtually impossible. Since I hadn't played with XMLReader much, I thought it would be a good chance to give it a spin. For the anxious types, the code is available on <a href="http://github.com/jsjohnst/php_class_lib/tree/master">github in my php_class_lib project</a>, so dig right in.
</blockquote>
<p>
His <a href="http://www.jeremyjohnstone.com/blog/archives/2008/10/26/php-parser-for-os-x-plist-xml-files/">parser</a> takes in the name of the file to fetch and a parser() method is called to do the actual work. The contents of the file are returned as an array (he includes a print_r() of that output too).
</p>]]></description>
      <pubDate>Mon, 27 Oct 2008 09:35:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Weiske's Blog: Importing huge XML files using PHP5 - efficiently and conveniently]]></title>
      <guid>http://www.phpdeveloper.org/news/10889</guid>
      <link>http://www.phpdeveloper.org/news/10889</link>
      <description><![CDATA[<p>
<i>Christian Weiske</i> has a <a href="http://cweiske.de/tagebuch/Importing%20huge%20XML%20files%20using%20PHP5%20-%20efficiently%20and%20conveniently.htm">quick tip</a> on how to get larger XML files to pull into PHP5 and be usable:
</p>
<blockquote>
At work I had the task to implement the synchronization between an online shop and a commodity management system. Data exchange format was XML - one big XML file for all of the products (some thousands with dozens of attributes). Big question: How do I import the file in a way that is most convenient for me as a programmer - and without exceeding the machine's RAM when loading a 1 GiB file?
</blockquote>
<p>
The newer alternatives both use the same technology (DOM and SimpleXML - with DOM behind it) so he goes more "low tech" than that and opts for the XMLReader extension to pull in the large amounts of data. Available in PHP5, the XMLReader extension, which he combines with an Iterator from the SPL to makes for a simple, quick little parser.
</p>]]></description>
      <pubDate>Mon, 25 Aug 2008 09:34:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: XML and PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/8369</guid>
      <link>http://www.phpdeveloper.org/news/8369</link>
      <description><![CDATA[<p>
The Zend Developer Zone has <a href="http://devzone.zend.com/article/2387-XML-and-PHP-5">a new tutorial</a> posted looking at PHP5 and the new XML tools that it has to offer - as broken up into categories:
</p>
<ul>
<li>the <a href="http://us.php.net/dom">DOM functionality</a> (replacing DOM XML, ext/dom)
<li><a href="http://us.php.net/manual/en/ref.simplexml.php">SimpleXML</a>
<li><a href="http://us.php.net/manual/en/ref.xmlreader.php">XMLReader</a> (replacing the ext/xml extension)
<li><a href="http://us.php.net/manual/en/ref.xmlwriter.php">XMLWriter</a>
<li><a href="http://us.php.net/manual/en/ref.xsl.php">XSL</a>
</ul>
<blockquote>
Things are a bit different using XML in PHP 5. In a similar scenario, you could use one of the new native extensions, like DOM or SimpleXML, to manipulate the XML data tree. This tree can then be passed directly to and used by the XSL extension without incurring any additional overhead. There is no serialization nor copying involved; ext/xsl is able to work directly with the XML tree it is given, resulting in a significant improvement in use of system resources as compared to coding a similar task in PHP 4. So now that you have an idea why XML support got a face lift, you might like to know about the different tools available to you.
</blockquote>]]></description>
      <pubDate>Wed, 01 Aug 2007 10:13:00 -0500</pubDate>
    </item>
  </channel>
</rss>
