<?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>Sun, 19 May 2013 17:17:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPBuilder.com: PHP Simple HTML DOM Parser: Editing HTML Elements in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16833</guid>
      <link>http://www.phpdeveloper.org/news/16833</link>
      <description><![CDATA[<p>
On PHPBuilder.com today there's a new tutorial from <i>Vojislav Janjic</i> about using a <a href="http://www.phpbuilder.com/columns/PHP_HTML_DOM_parser/PHPHTMLDOMParser.cc_09-07-2011.php3">simple DOM parser</a> in PHP to edit the markup even if it's not correctly W3C-formatted - the <a href="http://simplehtmldom.sourceforge.net/">Simple HTML DOM Parser</a>
</p>
<blockquote>
Simple HTML DOM parser is a PHP 5+ class which helps you manipulate HTML elements. The class is not limited to valid HTML; it can also work with HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to those in jQuery. You can find elements by ids, classes, tags, and much more. DOM elements can also be added, deleted or altered. 
</blockquote>
<p>
They help you get started using the parser, passing in the HTML content to be handled (either directly via a string or loading a file) and locating elements in the document either by ID, class or tag. Selectors similar to those in CSS are available. Finally, they show how to find an object and update its contents, either by adding more HTML inside or by appending a new object after it.
</p>]]></description>
      <pubDate>Thu, 08 Sep 2011 10:06:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Fabien Potencier's Blog: Parsing XML documents with CSS selectors]]></title>
      <guid>http://www.phpdeveloper.org/news/14288</guid>
      <link>http://www.phpdeveloper.org/news/14288</link>
      <description><![CDATA[<p>
In a new post <i>Fabien Potencier</i> talks about how he took the Python <a href="http://codespeak.net/lxml/cssselect.html">lxml.cssselect</a> component from Python, ported it over to PHP and made a library that allows you to parse XML with the handy CSS selectors rather than using XPath.
</p>
<blockquote>
Odds are you [also] need to parse some from time to time: because you consume a web service and want to extract some information, or because you want to gather data from scraped web pages, or just because you want to write functional tests for a website. 
</blockquote>
<p>
The <a href="http://github.com/fabpot/symfony/tree/master/src/Symfony/Components/CssSelector/">CssSelector tool</a> allows you to convert a CSS selector into an XPath that can, in turn, be pushed into the XPath function of the PHP DOM XML functionality. He gives a few examples of using it for a simple "find" and for something more complex involving a SimpleXML object too.
</p>
<p>
The library can be <a href="http://github.com/fabpot/symfony/tree/master/src/Symfony/Components/CssSelector/">downloaded from github here</a>.
</p>]]></description>
      <pubDate>Fri, 02 Apr 2010 09:41:27 -0500</pubDate>
    </item>
  </channel>
</rss>
