但是,在 XSLT 中使用 PHP 函数时,很多人会遇到如下两种错误:
(1) Warning: XSLTProcessor::transformToXml(): xmlXPathCompiledEval: 1 objects left o
n the stack.
(2)PHP Warning: XSLTProcessor::transformToXml(): xmlXPathCompOpEval: function func
tion bound to undefined prefix php in ….
| 代码如下 | 复制代码 | |
|
<?php Users
EOB; $xmldoc = DOMDocument::loadXML($xml); $xsldoc = DOMDocument::loadXML($xsl); $proc = new XSLTProcessor(); $proc->registerPHPFunctions(); $proc->importStyleSheet($xsldoc); echo $proc->transformToXML($xmldoc); ?> |
||
其实,出现这种错误,是因为我们没有定义 PHP namespace ,只需要在
| 代码如下 | 复制代码 |
|
xmlns:xsl="http://www.***w3.org/1999/XSL/Transform"> |
|
中增加 xmlns:php="http://php*.net**/xsl" 就能解决此问题, 即
| 代码如下 | 复制代码 |
|
xmlns:xsl="http://www.***w3.org/1999/XSL/Transform" |
|
韩剧再婚皇后阿里云盘全集高清1080P资源链接-韩剧再婚皇后免费阿里云盘资源下载4K高清无删减版链接
poipiku网站如何打开-poipiku官网网页版访问入口
明日方舟:终末地-云游戏畅玩入口-明日方舟:终末地-网页版在线直连地址
poki在线小游戏网页版-poki免费游戏大全入口
poki游戏入口-点开即玩-poki游戏-在线免费畅玩
原神akt大佬资源viciNeko入口链接-原神akt大佬资源网页vicineko入口链接分享