📄 htmltable.xsl
字号:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/root">
<HTML>
<style>
table {
background-color: #000;
border-collapse: collapse;
border: 0px;
border-spacing: 0px;
text-align: left;
}
th {
border: 1px solid #fff;
background-color: #ccc;
color: #000;
}
td {
border: 1px solid #fff;
background-color: #dddddd;
color: #000;
}
</style>
<BODY>
<xsl:apply-templates />
</BODY>
</HTML>
</xsl:template>
<xsl:template match="s">
<TABLE>
<xsl:apply-templates />
</TABLE>
<BR />
</xsl:template>
<xsl:template match="h">
<TR>
<xsl:apply-templates />
</TR>
</xsl:template>
<xsl:template match="r">
<TR>
<xsl:apply-templates />
</TR>
</xsl:template>
<xsl:template match="r/d">
<TD nowrap="1">
<xsl:if test="@isNull">
<i>
<FONT COLOR="blue">null</FONT>
</i>
</xsl:if>
<xsl:value-of select="." />
</TD>
</xsl:template>
<xsl:template match="truncate">
<xsl:variable name="cols" select="count(../r[1]/d)" />
<TR>
<TD colspan="{$cols}" nowrap="1">
<font color="red">Result truncated !</font>
</TD>
</TR>
</xsl:template>
<xsl:template match="h/c">
<xsl:choose>
<xsl:when test="contains(@t,'char')">
<TH title="{@t}[{@l}]">
<FONT COLOR="navy">
<xsl:value-of select="." />
</FONT>
</TH>
</xsl:when>
<xsl:otherwise>
<TH title="{@t}">
<xsl:value-of select="." />
</TH>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="resultsetX">
<TABLE>
<TR>
<xsl:for-each select="row[position() = 1]/*">
<TH>
<xsl:value-of select="local-name()"/>
</TH>
</xsl:for-each>
</TR>
<xsl:apply-templates />
</TABLE>
<BR />
</xsl:template>
<xsl:template match="error">
<TABLE>
<TR>
<TH>Error !</TH>
</TR>
<xsl:apply-templates />
</TABLE>
<BR />
</xsl:template>
<xsl:template match="error/msg">
<TR>
<TD>
<xsl:value-of select="." />
</TD>
</TR>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -