⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shopclass.xsl

📁 简单的treeview加tml结合的源码
💻 XSL
字号:
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo" >
<xsl:output omit-xml-declaration="yes" method="html" encoding="gb2312"/>

<xsl:param name="urlpath" select="'lt'"/>

<xsl:template match="/shopclass">
  <html>
			<head>
				
				<LINK href="ltFileOut.aspx?file=css" type="text/css" rel="stylesheet"/>
				<script language="javascript" src="ltFileOut.aspx?file=js" type="text/javascript"></script>
				<script language="JavaScript" >
				    var path = "<xsl:value-of select="$urlpath"></xsl:value-of>";
				    <![CDATA[ 

                    
			        function changeNodestyle(el)
			        {
			          el.className="treenode1";
			        }
			        function oldStyle(el)
			        {
			          el.className="treenode";
			        }
			        function changeimage(el,node,t)
			        {
			        
			           var a=el.getAttribute("src");
			           var strs=a.split("/");
			           var i=strs.length;
			           if(strs[i-1]!="NodeImg2.gif")
			           {
			              el.setAttribute("src",path+"NodeImg2.gif");
			              getChildNode(node);
			             
			              var div=document.getElementById("l_"+node);
			              div.className="treenode";
			             
			           }
			           else
			           {
			              clearnode(node,t);
			              el.setAttribute("src",path+"NodeImg1.gif");
			           }
			        }
			        function clearnode(node,t)
			        {
			          
			          var div=document.getElementById("l_"+node);
			          
			          while(div.hasChildNodes())
			          {
			             div.removeChild(div.firstChild);
			          }			         
			          //div.innerHTML = t ;
			        }
					
		]]></script>
		
			</head>
			<body>
			<table width="90%" align="center"><div  class="tree"><xsl:apply-templates select="class"/></div></table>
			</body>
		</html>
	  
</xsl:template>


<xsl:template match="class">	 
  <div  class="tree">
  <xsl:if test="@pnode=0">
     <xsl:if test="@child=1">
         <a href="#" >
			<img onclick="changeimage(this,{@node},'{@title}')" src="{$urlpath}NodeImg1.gif" border="0">
            </img>
         </a>
    </xsl:if>
    <xsl:if test="@child=0">
		<a href="#" >
			<img src="{$urlpath}NodeImg0.gif"  border="0"></img>
		</a>
	</xsl:if>
	 <Label  class="treenode"  onmouseout="oldStyle(this)" onmouseover="changeNodestyle(this)" >
		<a  href="editCataNode.aspx?num={@node}" target="main">
			<xsl:value-of select="@title"></xsl:value-of>
		</a>
	</Label>
  </xsl:if>
  <xsl:if test="@child=1">
    <div id="l_{@node}"></div>
  </xsl:if>
</div>
</xsl:template>

</xsl:stylesheet>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -