如果你在php5中用xslt_create()這個(gè)php4中的方法時(shí),將會(huì )得到call to undefined function xslt_create()這個(gè)error。
reason is : 該擴展已經(jīng)從 PHP 5 中移出,然后移入到 PECL 倉庫中。 php5的ext目錄下已經(jīng)沒(méi)有php_xslt.dll了,取而代之的是php_xsl.dll。
the sample below shows how to use php_xsl.dll in php5
<?php
/* Load the two XML sources */
$xml = new DomDocument; // from /ext/dom
$xml->load('example.xml');
$xsl = new DomDocument;
$xsl->load('example.xsl');
/* Configure the transformer */
$proc = new xsltprocessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml); // actual transformation
?>
詳見(jiàn)
http://www.php.net/manual/en/ref.xsl.php