Zend Developer Zone
Where the ElePHPants come to learn

Zend Developer Zone

Tag Archive: XML

PHP DOM XML extension encoding processing

I recently worked with PHP’s DOM XML extension while working on href="http://framework.zend.com/">Zend Framework’s
Zend_Search_Lucene HTML highlighting capabilities, and uncovered some
undocumented features and issues with the extension in regards to character
encoding. The information contained in this article should also apply to
other libxml-based DOM implementations, as PHP’s DOM extension simply wraps
that library.

Serving XHTML in a Zend Framework Application

Serving XHTML is often misunderstood by php developers. Frontend engineers simply include the XHTML doctype to their documents, without actually serving document as XHTML. This triggers majority of the browsers to treat such pages as ‘tag-soup’.

If you are building a Zend Framework application and you really care for faster XHTML rendering , you can get its benefit by using content negotiation, thanks to the new controller plugin we have for you.

XML and PHP 5

It is probably safe to assume that everyone by now has seen the PHP 5 release announcements or at least have heard that XML support has been given a complete overhaul. Although I am still surprised with those I talk to who are still developing with PHP 4 and actively working with XML, rather than upgrading to PHP 5 to use the new XML tool sets, I guess it might be a bit scary to think about such an upgrade. Both ext/xslt and ext/domxml have been removed from the core PHP distribution and replaced with completely new extensions, resulting in the need to review and typically re-write all older code relying on either of those extensions in order to upgrade.