📄 viewchatlog.xsl
字号:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="Sort" select="//Sort" />
<xsl:param name="SortBy">
@<xsl:value-of select="$Sort"/>
</xsl:param>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
@charset "utf-8";
/* CSS Document */
body
{
margin: 3;
padding:3;
text-align: left;
color: #000000;
}
td
{
font-size:14px;
padding: 3px;
text-align:left;
}
a:hover{
color: #000;
text-decoration: underline;
}
a
{
color:blue;
text-decoration:none;
}
input,select,option,button,textarea
{
BACKGROUND-COLOR: #FFFFFF;
BORDER-COLOR:#A1A1A1;
BORDER-WIDTH:1;
BORDER-STYLE:ridge;
BORDER-BOTTOM: #A1A1A1 1px solid;
BORDER-LEFT: #A1A1A1 1px solid;
BORDER-RIGHT: #A1A1A1 1px solid;
BORDER-TOP: #A1A1A1 1px solid;
COLOR: #555555;
FONT-SIZE: 14px;
FONT-FAMILY: "Verdana", "Arial";
}
</style>
</head>
<body>
<!--
This is an XSLT template file. Fill in this area with the
XSL elements which will transform your XML to XHTML.
-->
<xsl:choose>
<xsl:when test="//Step='0'">
<xsl:call-template name="ShowLogin"/>
</xsl:when>
<xsl:otherwise>
<table>
<tr>
<td valign="top">
<!--<xsl:call-template name="ShowList" />-->
Sort By :
<a href="?Act=List&Sort=Name">
Name
</a>
<a href="?Act=List&Sort=Date">
Date
</a><br/>
<!--<xsl:apply-templates select="//file"/>-->
<xsl:choose>
<xsl:when test="$Sort='Date'">
<xsl:call-template name="fielListByDate" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="fielList"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td valign="top">
<xsl:if test="//Step='2'">
<xsl:call-template name="ReadLog" />
</xsl:if>
</td>
</tr>
</table>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>
<xsl:template name="ShowLogin" >
<form method="post" action="?Act=Login">
Username:<input name="name" /><br/>
Password:<input type="password" name="pass" /><br/>
<input value="Enter" type="submit" />
</form>
</xsl:template>
<xsl:template name="fielList">
<xsl:for-each select="//file">
<xsl:sort data-type="text" order="ascending" select="@Name"/>
<a href="?Act=Read&Sort={$Sort}&f={.}">
<xsl:value-of select="."/>
</a>
<br/>
</xsl:for-each>
</xsl:template>
<xsl:template name="fielListByDate">
<xsl:for-each select="//file">
<xsl:sort data-type="text" order="ascending" select="@Date"/>
<a href="?Act=Read&Sort={$Sort}&f={.}">
<xsl:value-of select="."/>
</a>
<br/>
</xsl:for-each>
</xsl:template>
<xsl:template name="ReadLog">
Type List:<xsl:for-each select="//CustType/Item">
<xsl:sort data-type="number" select="./@Value" order="ascending"/>
(<xsl:value-of select="./@Value"/>)<xsl:value-of select="."/>
</xsl:for-each>
<table border="0" width="100%" id="table1" cellspacing="1">
<xsl:for-each select="//guest">
<xsl:variable name="type" select="./@type"/>
<xsl:variable name="guest" select="./@name"/>
<tr>
<td bgcolor="#99CCFF">
<font color="#66666">
Guest:</font>
<font color="red">
<b>
<xsl:value-of select="./@name" />
</b>
</font>
<font color="#666666">Email:</font><font color="red"><xsl:value-of select="./@mail" /> </font>
<font color="#666666">
type:
<xsl:value-of select="./@type" />
</font>
<font color="#666">loginTime:
<xsl:value-of select="./@loginTime" />
</font>
</td>
</tr>
<xsl:for-each select="./msg">
<tr>
<xsl:choose>
<xsl:when test="./@from='0'">
<td bgcolor="#DDDDDD">
<font color="red">
<b>
<xsl:value-of select="$guest"/>
</b>
</font> <font color="#666666">
at <xsl:value-of select="./@time"/>
</font>
<br/>
<font color="red">
<xsl:value-of disable-output-escaping="yes" select="."/>
</font>
</td>
</xsl:when>
<xsl:otherwise>
<td bgcolor="#CCCCCC">
<font color="blue">
<b>
<xsl:value-of select="//fileInfo/@loginName"/>
</b>
</font>
<font color="#666666">
at <xsl:value-of select="./@time"/>
</font>
<br/>
<font color="blue">
<xsl:value-of disable-output-escaping="yes" select="."/>
</font>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -