PHP with XSL & XML


PHP with XSL & XML

我有两个文件student.xml&sytle_student.xsl和一个PHP文件可能包含在xml文件中搜索数据的表单,但结果没有以xsl文件中附带的样式显示我用了这个功能

               $xslDoc = new DOMDocument();
               $xslDoc->load("style_student.xsl");
               $xmlDoc = new DOMDocument();
               $xmlDoc->load("student.xml");
               $proc = new XSLProcessor();
               $proc->importStylesheet($xslDoc);
                    echo $proc->transformToXML($xmlDoc);

但它在这条线上产生了2个错误

               $proc = new XSLProcessor();

错误:在第51行的C:''wamp''www''index.php中找不到类"XSLProcessor"

如何处理此错误以使用xsl样式显示ya结果??

该类称为XSLTProcessor,扩展名为ext/xsl

检查扩展名ext.xsl是否已加载。

var_dump(extension_loaded('xsl'));

如果没有安装扩展和/或更改php.ini以激活它。