<?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 21:01:50 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[James Morris' Blog: Parsing HTML with DOMDocument and DOMXPath::Query]]></title>
      <guid>http://www.phpdeveloper.org/news/18145</guid>
      <link>http://www.phpdeveloper.org/news/18145</link>
      <description><![CDATA[<p>
In the latest post to his blog <i>James Morris</i> looks at <a href="http://blog.jmoz.co.uk/domdocument-domxpath-html-parsing">using XPath's query() function</a> to locate pieces of data in your XML.
</p>
<blockquote>
The other day I needed to do some html scraping to trim out some repeated data stuck inside nested divs and produce a simplified array of said data. My first port of call was SimpleXML which I have used many times. However this time, the son of a bitch just wouldn't work with me and kept on throwing up parsing errors. I lost my patience with it and decided to give DomDocument and DOMXpath a go which I'd heard of but never used.
</blockquote>
<p>
He includes a code (and XML document) example showing how to extract out some content from an HTML structure - grabbing each of the images from inside a div and associating them with their description content.
</p>]]></description>
      <pubDate>Wed, 27 Jun 2012 10:19:35 -0500</pubDate>
    </item>
  </channel>
</rss>
