Paul Stamatiou details XML parsing in PHP 5 using SimpleXML. SimpleXML lets you navigate the XML document as a data structure. PHP 5 also introduces a class called XMLReader that operates in stream mode and lets you do pull parsing. Pull parsing lets the client pull data from the XML document whenever required, which is perfect for parsing huge XML documents, without any disadvantages of the DOM or SAX models.

April 19th, 2007 at 2:41 am
Simple XML is simply amazing! I utilized it with my Technorati Rank plugin. Folks running older versions of PHP are upset that I didn’t support it, but the old way of using DOM and looping through nodes is server-intense and complex.
April 19th, 2007 at 10:02 am
Very true Douglas! SimpleXML has really made working with XML simpler. I wonder if SimpleXML extension can be provided to PHP 4.* too. Just a thought, I believe a lot of people are going to be hesitant in moving to PHP 5.