XSL Cache by The New York Times

11 enero 2008 at 11:10

Fecha Filed in Computers
Tags Tags: , , , ,

The XSL Cache extension is a mod of PHP’s XSL extension developed by the NYTimes. This extension caches the parsed XSL stylesheet representation in sites that constantly the same transform is applied. The code is already working with a few applications on the New York Times’ website.

The installation is very easy. Just run the following commands:

phpize
./configure --with-xslcache=
 –with-xsl-exsl-dir=</path><path to libexslt>
make
sudo make install
</path>

Then you have only to add the line extension=xslcache.so to php.ini file and restart the web server. I’ve been doing some tests with XSL Cache and I got good results. The following code shows how to load a stylesheet and then use it to transform a parsed XML document:

<?php
$xsltpath = '/home/harrisj/example.xsl';

$xslt = new xsltCache;
$xslt->importStyleSheet($xsltpath);
$xml = DOMDocument::loadXML($source_doc);
print $xslt->transformToXML($xml);
?>

XSL Cache Logo

Link | XSL Cache Project

Comments Comments (1) XSL Cache by The New York Times Permalink Votar: Positive 0 Negative 0