📄 tree.xsl
字号:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="/TreeView/Tree"/>
</xsl:template>
<xsl:template match="Tree">
<div class="clsItem" type="parent">
<xsl:if test="count(child::*) > 0">
<xsl:choose>
<xsl:when test="@Expanded">
<xsl:attribute name="Expanded">
<xsl:value-of select="@Expanded"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise><xsl:attribute name="Expanded">false</xsl:attribute></xsl:otherwise>
</xsl:choose>
</xsl:if>
<span>
<xsl:if test="count(child::*) > 0">
<xsl:attribute name="onclick">Expand(this)</xsl:attribute>
</xsl:if>
<xsl:attribute name="Class">clsSpace</xsl:attribute>
<xsl:choose>
<xsl:when test="count(child::*) > 0">
<xsl:choose>
<xsl:when test="@Expanded">
<xsl:choose>
<xsl:when test="@Expanded[.='true']">
<span class='clsExpand'>-</span>
</xsl:when>
<xsl:otherwise><span class='clsCollapse'>+</span></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><span class='clsCollapse'>+</span></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><span class='clsLeaf'>.</span></xsl:otherwise>
</xsl:choose>
</span>
<span class='clsLabel' onmouseover="MouseOver(this)" onclick="Click(this)" onmouseout="MouseOut(this)" onmousedown="MouseDown(this)" onmouseup="MouseUp(this)">
<xsl:attribute name="title"><xsl:value-of select="@Text" /></xsl:attribute>
<xsl:attribute name="NodeID"><xsl:value-of select="@NodeID" /></xsl:attribute>
<xsl:choose>
<xsl:when test="@URL">
<a>
<xsl:choose>
<xsl:when test="@Target">
<xsl:attribute name="target"><xsl:value-of select="@Target" /></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="Href">
<xsl:value-of select="@URL"/>
</xsl:attribute>
<xsl:value-of select="@Text"/>
</a>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@Text"/></xsl:otherwise>
</xsl:choose>
</span>
<xsl:if test="count(child::*) > 0">
<div>
<xsl:choose>
<xsl:when test="@Expanded">
<xsl:choose>
<xsl:when test="@Expanded[.='true']">
<xsl:attribute name="class">shown</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">hide</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">hide</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@Expanded">
<xsl:attribute name="Expanded">
<xsl:value-of select="@Expanded"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise><xsl:attribute name="Expanded">false</xsl:attribute></xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="Tree"></xsl:apply-templates>
</div>
</xsl:if>
</div>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -