找不到类“XSLTProcessor" [英] Class "XSLTProcessor' not found

查看:46
本文介绍了找不到类“XSLTProcessor"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 XSLT 将 XML 文件转换为 HTML 输出..

I'm trying to transform a XML file to a HTML output with XSLT..

我的代码如下:

<?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"类

But I'm getting the error: Fatal error: Class 'XSLTProcessor' not found

我知道这与 xsltprocessor 未在我的服务器上使用 PHP 编译的事实有关...但我似乎找不到启用它的方法.(我不控制服务器,但我的主机可以)

I know this has something to do with the fact dat the xsltprocessor is not compiled with PHP on my server... But I can't seem to find a way to enable it. (I do not control the server, but my hosting does)

推荐答案

只需安装:sudo apt-get install php5-xsl

并重启你的 APACHE 服务器 ;)

这篇关于找不到类“XSLTProcessor"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆