【发布时间】:2012-01-27 18:31:26
【问题描述】:
我正在尝试使用 XSLT 将 XML 文件转换为 HTML 输出。
我的代码如下:
<?php
$xml = new DOMDocument;
$xml->load('file.xml');
$xsl = new DOMDocument;
$xsl->load('file.xsl');
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($xml);
?>
但我收到错误:致命错误:找不到类“XSLTProcessor”
我知道这与 xsltprocessor 未在我的服务器上使用 PHP 编译的事实有关……但我似乎找不到启用它的方法。 (我不控制服务器,但我的主机控制)
【问题讨论】: