选择显示字体大小

我也贴一个,用的时候只要配制好xml文件就行了,连程序都不用改


   使用时需要加载xslt模块,程序下载地址:http://xiaocon.51.net/tree/tree.zip
演示地址:

http://xiaocon.51.net/tree/tree.htm



http://xiaocon.51.net/tree/navi.xml

51.net上不支持xslt :(
程序文件:
===========================================================
<?php
&#36;xslstring = implode(&#39;&#39;,file(&quot;navigator.xsl&quot;));
&#36;xmlstring = implode(&#39;&#39;,file(&quot;navi.xml&quot;));
&#36;arguments = array(
     &#39;/_xml&#39; => &#36;xmlstring,
     &#39;/_xsl&#39; => &#36;xslstring
);

&#36;xh = xslt_create();

&#36;result = xslt_process(&#36;xh, &#39;arg:/_xml&#39;, &#39;arg:/_xsl&#39;, null, &#36;arguments);
if (&#36;result) {
    print &#36;result;
}
else {
    print &quot;err&quot;;
    
}
xslt_free(&#36;xh);

?>
xml文件
===========================================================
<?xml version=&quot;1.0&quot; encoding=&quot;gb2312&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;navigator.xsl&quot; ?>
<navigation>

    <navigator id=&quot;1&quot; ancestorid=&quot;1&quot; layer=&quot;0&quot; title=&quot;花园首页&quot; childs=&quot;0&quot; url=&quot;default.asp&amp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;2&quot; ancestorid=&quot;2&quot; layer=&quot;0&quot; title=&quot;我的花园&quot; childs=&quot;4&quot; url=&quot;#&quot; image=&quot;default&quot;/>
    <navigator id=&quot;3&quot; ancestorid=&quot;2&quot; layer=&quot;1&quot; title=&quot;收藏夹&quot; childs=&quot;4&quot; url=&quot;#&quot; image=&quot;default&quot;/>
    <navigator id=&quot;21&quot; ancestorid=&quot;3&quot; layer=&quot;2&quot; title=&quot;我管理的花坛&quot; childs=&quot;0&quot; url=&quot;mybbs.asp?cat=g&quot; image=&quot;images/dc-new.gif&quot;/>
    <navigator id=&quot;22&quot; ancestorid=&quot;3&quot; layer=&quot;2&quot; title=&quot;我种下的种子&quot; childs=&quot;0&quot; url=&quot;mybbs.asp?cat=t&quot; image=&quot;images/dc-new.gif&quot;/>
    <navigator id=&quot;23&quot; ancestorid=&quot;3&quot; layer=&quot;2&quot; title=&quot;我喜欢的花园&quot; childs=&quot;0&quot; url=&quot;myfavorite.asp?cat=g&s=test&quot; image=&quot;images/dc-new.gif&quot;/>
    <navigator id=&quot;24&quot; ancestorid=&quot;3&quot; layer=&quot;2&quot; title=&quot;我收藏的文章&quot; childs=&quot;0&quot; url=&quot;myfavorite.asp?cat=t&quot; image=&quot;images/dc-new.gif&quot;/>
    <navigator id=&quot;4&quot; ancestorid=&quot;2&quot; layer=&quot;1&quot; title=&quot;个人工具箱&quot; childs=&quot;2&quot; url=&quot;#&quot; image=&quot;default&quot;/>
    <navigator id=&quot;25&quot; ancestorid=&quot;4&quot; layer=&quot;2&quot; title=&quot;配置和管理&quot; childs=&quot;0&quot; url=&quot;personal.asp&quot; image=&quot;images/dc-config.gif&quot;/>
    <navigator id=&quot;26&quot; ancestorid=&quot;4&quot; layer=&quot;2&quot; title=&quot;花瓣兑换点&quot; childs=&quot;0&quot; url=&quot;apetal.asp&quot; image=&quot;images/dc-config.gif&quot;/>
    <navigator id=&quot;27&quot; ancestorid=&quot;2&quot; layer=&quot;1&quot; title=&quot;我的日记本&quot; childs=&quot;0&quot; url=&quot;mydiary.asp&quot; image=&quot;images/dc-diary.gif&quot;/>
    <navigator id=&quot;6&quot; ancestorid=&quot;2&quot; layer=&quot;1&quot; title=&quot;好友和短讯&quot; childs=&quot;0&quot; url=&quot;myfriend.asp&quot; image=&quot;images/dc-friends.gif&quot;/>
    <navigator id=&quot;7&quot; ancestorid=&quot;7&quot; layer=&quot;0&quot; title=&quot;计算机技术&quot; childs=&quot;2&quot; url=&quot;#&quot; image=&quot;default&quot;/>
    <navigator id=&quot;8&quot; ancestorid=&quot;7&quot; layer=&quot;1&quot; title=&quot;dhtml,jscript&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;9&quot; ancestorid=&quot;7&quot; layer=&quot;1&quot; title=&quot;.net,asp+探讨&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;10&quot; ancestorid=&quot;7&quot; layer=&quot;1&quot; title=&quot;asp互助&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;11&quot; ancestorid=&quot;11&quot; layer=&quot;0&quot; title=&quot;箐箐校园&quot; childs=&quot;2&quot; url=&quot;#&quot; image=&quot;default&quot;/>
    <navigator id=&quot;12&quot; ancestorid=&quot;11&quot; layer=&quot;1&quot; title=&quot;南京大学&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;13&quot; ancestorid=&quot;11&quot; layer=&quot;1&quot; title=&quot;东南大学&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;14&quot; ancestorid=&quot;14&quot; layer=&quot;0&quot; title=&quot;花园·有个广场&quot; childs=&quot;2&quot; url=&quot;#&quot; image=&quot;default&quot;/>
    <navigator id=&quot;15&quot; ancestorid=&quot;14&quot; layer=&quot;1&quot; title=&quot;意见箱&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;16&quot; ancestorid=&quot;14&quot; layer=&quot;1&quot; title=&quot;花园·人物故事&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;17&quot; ancestorid=&quot;17&quot; layer=&quot;0&quot; title=&quot;园丁办公室&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc-key.gif&quot;/>
    <navigator id=&quot;18&quot; ancestorid=&quot;18&quot; layer=&quot;0&quot; title=&quot;青青芳草地&quot; childs=&quot;0&quot; url=&quot;bbsgroup.asp&quot; image=&quot;images/dc.gif&quot;/>
    <navigator id=&quot;19&quot; ancestorid=&quot;19&quot; layer=&quot;0&quot; title=&quot;统计信息&quot; childs=&quot;0&quot; url=&quot;viewlog.asp&quot; image=&quot;images/dc-chart.gif&quot;/>
    <navigator id=&quot;20&quot; ancestorid=&quot;20&quot; layer=&quot;0&quot; title=&quot;activecard&quot; childs=&quot;0&quot; url=&quot;activecard?fromgarden&quot; image=&quot;images/dc-card.gif&quot;/>
</navigation>


xslt文件

============================================================
<?xml version=&quot;1.0&quot; encoding=&quot;gb2312&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/xsl/transform&quot;>
    <xsl:output method =&quot;html&quot; version=&quot;1.0&quot; encoding=&quot;gb2312&quot; indent=&quot;yes&quot;/>
    <xsl:template match=&quot;/&quot;>
<html>
    <head>
        <title>xslt树形导航栏</title>
        <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;navigator.css&quot;/>
        <script src=&quot;toggle.js&quot;></script>
    </head>
    <body>
    
        <div >
            <table>
                <tr>
                    <td><div nowrap=&quot;true&quot; style=&quot;padding-left:0em;&quot;>有座花园分类目录</div></td>
                </tr>
                <xsl:for-each select=&quot;navigation/navigator&quot;>
                    <tr>
                        <xsl:attribute name=&quot;title&quot;><xsl:value-of select=&quot;@title&quot; /></xsl:attribute>
                        <xsl:attribute name=&quot;class&quot;>navigator<xsl:if test=&quot;@layer[.>0]&quot;>-hidden</xsl:if></xsl:attribute>
                        <xsl:attribute name=&quot;id&quot;><xsl:value-of select=&quot;@id&quot;/></xsl:attribute>
                        <xsl:attribute name=&quot;ancestorid&quot;><xsl:value-of select=&quot;@ancestorid&quot;/></xsl:attribute>
                        <xsl:attribute name=&quot;depth&quot;><xsl:value-of select=&quot;@layer&quot;/></xsl:attribute>
                        <xsl:if test=&quot;@childs[.>0]&quot;>
                        <xsl:attribute name=&quot;expanded&quot;>no</xsl:attribute>
                    </xsl:if>
                        <td style=&quot;cursor:hand&quot;>
                        <div nowrap=&quot;true&quot;><xsl:attribute name=&quot;style&quot;>padding-left:<xsl:value-of select=&quot;@layer&quot;/>em;</xsl:attribute>
                        <xsl:choose>
                        <xsl:when test=&quot;@childs[.>0]&quot;><img src=&quot;images/bs.gif&quot;><xsl:attribute name=&quot;onclick&quot;>toggle(&#39;<xsl:value-of select=&quot;@id&quot; />&#39;)</xsl:attribute></img></xsl:when>
                        <xsl:otherwise><img><xsl:attribute name=&quot;src&quot;><xsl:value-of select=&quot;@image&quot; /></xsl:attribute></img></xsl:otherwise>
                    </xsl:choose>
                        <a><xsl:if test=&quot;@childs[.>0]&quot;><xsl:attribute name=&quot;onclick&quot;>toggle(&#39;<xsl:value-of select=&quot;@id&quot; />&#39;)</xsl:attribute></xsl:if><xsl:attribute name=&quot;href&quot;><xsl:value-of select=&quot;@url&quot; /></xsl:attribute><xsl:value-of select=&quot;@title&quot; /></a></div></td>
                    </tr>
                </xsl:for-each>
            </table>
        </div>
    </body>
</html>
</xsl:template>
</xsl:stylesheet>


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons