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

📄 tree.xsl.svn-base

📁 菲律宾的一个大学的图书管理系统 spring+hibernate+velocity
💻 SVN-BASE
字号:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="urn:schemas-microsoft-com:datatypes">

<xsl:template match="tree">
  <xsl:apply-templates select="entity"/>
</xsl:template>

<xsl:template match="entity">
  <div onclick="window.event.cancelBubble = true;clickOnEntity(this);" onselectstart="return false" ondragstart="return false">
  <xsl:attribute name="image"><xsl:value-of select="image"/></xsl:attribute>
  <xsl:attribute name="imageOpen"><xsl:value-of select="imageOpen"/></xsl:attribute>
  <xsl:attribute name="open">false</xsl:attribute>
  <xsl:attribute name="id">f<xsl:value-of select="@id"/></xsl:attribute>
  <xsl:attribute name="open">false</xsl:attribute>

  <xsl:attribute name="onclick">
	<xsl:value-of select="onClick" />	
	clickOnEntity(this);
  </xsl:attribute>
  
  <xsl:attribute name="STYLE">
    <xsl:choose>
			<xsl:when test="count(ancestor::node()) > 2">
				display: none;
			</xsl:when>
			<xsl:otherwise>
			
			</xsl:otherwise>
		</xsl:choose>
    cursor: hand;
  </xsl:attribute>
    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
				<td>
					<xsl:call-template name="hierarchy" />			
				</td>
        <td valign="middle">
          <img border="0" id="image">
            <xsl:attribute name="SRC">
              <xsl:value-of select="image"/>
            </xsl:attribute>
          </img>
        </td>
        <td valign="middle" nowrap="true" onmouseover="this.style.color = 'red'; this.style.fontWeight = 'bold';" onmouseout="this.style.color = 'black'; this.style.fontWeight = 'normal';">
        <xsl:attribute name="STYLE">
          padding-left: 7px;
          font-family: Verdana;
          font-size: 11px;
          font-color: black;
        </xsl:attribute>
        <xsl:value-of select="description"/></td>
      </tr>
    </table>
  <xsl:apply-templates select="contents/entity"/>
  </div>
</xsl:template>

<xsl:template name="hierarchy">
	<xsl:for-each select="ancestor::*[name() != contents]">
		<xsl:choose>
			<xsl:when test="following-sibling::node()">
				<img src="images/I.png"/>
			</xsl:when>
			<xsl:otherwise>
				<img src="images/blank.png"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	<xsl:choose>
		<xsl:when test="count(contents/*) > 0">
			<xsl:choose>
				<xsl:when test="following-sibling::*">
					<img src="images/Tplus.png" _open="images/Tminus.png" _closed="images/Tplus.png">
						<xsl:attribute name="ID">stateImagef<xsl:value-of select="@id"/></xsl:attribute>
					</img>
				</xsl:when>
				<xsl:otherwise>
					<img src="images/Lplus.png" _open="images/Lminus.png" _closed="images/Lplus.png">
						<xsl:attribute name="ID">stateImagef<xsl:value-of select="@id"/></xsl:attribute>
					</img>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:when>
		<xsl:otherwise>
			<xsl:choose>
				<xsl:when test="following-sibling::node()">
					<img src="images/T.png"/>
				</xsl:when>
				<xsl:otherwise>
					<img src="images/L.png"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
	
</xsl:stylesheet>

⌨️ 快捷键说明

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