News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



Greg Szorc's Blog:
Using DTD's and Catalogs for XHTML Validation
0 comments :: posted Thursday April 10, 2008 @ 11:29:48
voice your opinion now!

Greg Szorc shows how, in this entry on his blog, to use DTDs and catalogs to validate your XHTML pages with a little help from PHP.

This [validation from an external site like the W3C validator] approach is a good start, but it is far from ideal because it is based on an honor system of sorts. You often forget to validate each change you make and there is always some corner case that you forget. So, what can be done about it? Well, if you find yourself developing in PHP, you can employ the following solution.

The code he includes pulls in the XHTML content from your page (or the output of the framework's view layer) and pushes it into a DOMDocument that's build with the LIBXML_DTDLOAD and LIBXML_DTDATTR options.

tagged with: html validation dom extension document import



zendframework mysql ajax pecl PEAR application PHP5 cakephp release conference package database framework zend book code job developer security releases

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework