站内搜索
广告
我也贴一个,用的时候只要配制好xml文件就行了,连程序都不用改
作者:    来源:    点击:    日期:2007-6-21 0:35:58   

使用时需要加载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 :(
程序文件:
===========================================================
<?php
$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文件
===========================================================
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="navigator.xsl" ?>
<Navigation>

    <Navigator ID="1" AncestorID="1" Layer="0" Title="花园首页" Childs="0" Url="default.asp&amp" Image="images/dc.gif"/>
    <Navigator ID="2" AncestorID="2" Layer="0" Title="我的花园" Childs="4" Url="#" Image="default"/>
    <Navigator ID="3" AncestorID="2" Layer="1" Title="收藏夹" Childs="4" Url="#" Image="default"/>
    <Navigator ID="21" AncestorID="3" Layer="2" Title="我管理的花坛" Childs="0" Url="mybbs.asp?cat=g" Image="images/dc-new.gif"/>
    <Navigator ID="22" AncestorID="3" Layer="2" Title="我种下的种子" Childs="0" Url="mybbs.asp?cat=t" Image="images/dc-new.gif"/>
    <Navigator ID="23" AncestorID="3" Layer="2" Title="我喜欢的花园" Childs="0" Url="myfavorite.asp?cat=g&s=test" Image="images/dc-new.gif"/>
首页 上一页 [1] [2] [3] [4]  下一页 尾页 
我也贴一个,用的时候只要配制好xml文件就行了,连程序都不用改 评论