我也贴一个,用的时候只要配制好xml文件就行了,连程序都不用改_PHP
程序员文章站
2022-06-05 21:41:54
...
使用时需要加载XSLT模块,程序下载地址:http://xiaocon.51.net/tree/tree.zip
演示地址:
http://xiaocon.51.net/tree/tree.htm
" target=_blank>
http://xiaocon.51.net/tree/tree.htm
或
http://xiaocon.51.net/tree/navi.xml
" target=_blank>
http://xiaocon.51.net/tree/navi.xml
51.net上不支持xslt :(
程序文件:
===========================================================
$xslstring = implode(',file("navigator.xsl"));
$xmlstring = implode(',file("navi.xml"));
$arguments = array(
'/_xml' => $xmlstring,
'/_xsl' => $xslstring
);
$xh = xslt_create();
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
if ($result) {
print $result;
}
else {
print "Err";
}
xslt_free($xh);
?>
xml文件
===========================================================
XSLT文件
============================================================
XSLT树形导航栏
演示地址:
http://xiaocon.51.net/tree/tree.htm
" target=_blank>
http://xiaocon.51.net/tree/tree.htm
或
http://xiaocon.51.net/tree/navi.xml
" target=_blank>
http://xiaocon.51.net/tree/navi.xml
51.net上不支持xslt :(
程序文件:
===========================================================
$xslstring = implode(',file("navigator.xsl"));
$xmlstring = implode(',file("navi.xml"));
$arguments = array(
'/_xml' => $xmlstring,
'/_xsl' => $xslstring
);
$xh = xslt_create();
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
if ($result) {
print $result;
}
else {
print "Err";
}
xslt_free($xh);
?>
xml文件
===========================================================
XSLT文件
============================================================
上一篇: PHP扩展开发及内核应用
下一篇: 打开php错误提示 nginx+php