PHP and XSLT

Although there is nothing to stop you from creating an XML document and a corresponding XSLT stylesheet, you typically need to rely on a third-party XSLT processor (such as Sablotron) to combine the two. Web browsers today have limited XML parsing capabilities, and even less support for XSLT stylesheet processing; this implies that an intermediary layer, such as PHP, is required to perform the task of formatting XML data per XSLT-specified template rules.

PHP 4.0.6 (and later) comes with an XSLT extension designed specifically to provide a consistent interface to different XSLT processors (Sablotron, Xalan, and so on). Created by Sterling Hughes, this XSLT extension works much like an abstraction layer, exposing a generic API that ...

Get XML and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.