?? tree.xsl
字號:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:variable name="common-styles">
<STYLE>
.SpanDetails { CURSOR: hand ;color:#e6433c}
.Title {FONT-WEIGHT: normal; FONT-SIZE: 8pt; FONT-FAMILY: Tahoma, Verdana, Arial }
</STYLE>
</xsl:variable>
<xsl:variable name="common-script">
<script language="javascript"><![CDATA[
function clickHandler(v)
{
var theElement = v.parentElement;
var objChild=theElement.getElementsByTagName("DIV")[0];
if (objChild.style.display == "none")
objChild.style.display = "";
else
objChild.style.display = "none";
}
]]></script>
</xsl:variable>
<!-- channel newspaper -->
<xsl:template match="channel">
<html xmlns:m="http://www.w3.org/1998/Math/MathML">
<head>
<title>Channel</title>
<xsl:copy-of select="$common-styles"/>
<xsl:copy-of select="$common-script"/>
</head>
<body bgColor="#eeeeee" marginheight="1" marginwidth="1" language="javascript">
<table class="Title" border="0" width="100%" bgcolor="#FFFFFF" cellspacing="0" cellpadding="5">
<TR>
<TD>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
<TR>
<TD height="40" bgcolor="#EEEEEE">
<!-- channel title -->
<xsl:variable name="channelurl" select="link"/>
<b><a href="{$channelurl}"><font face="Verdana" size="4"><xsl:value-of select="title"/></font></a></b>
<xsl:if test="image">
<xsl:variable name="imgurl" select="image/url"/>
<xsl:variable name="imgtitle" select="image/title"/>
<xsl:variable name="imglink" select="image/link"/>
<xsl:choose>
<xsl:when test="url=''"></xsl:when>
<xsl:otherwise>
<br/>
<a href="{$imglink}"><img src="{$imgurl}" alt="{$imgtitle}" border="0"/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</TD>
</TR>
<TR>
<TD colspan="3" height="10" bgcolor="#C0C0C0"></TD>
</TR>
</table>
</TD>
</TR>
<tr>
<td>
<DIV>
<!-- loop through each news item -->
<xsl:for-each select="item">
<DIV>
<xsl:choose>
<xsl:when test="readed='false'">
<IMG src="$ImagesFolder$unread.gif" align="absmiddle" vspace="3"/>
</xsl:when>
<xsl:otherwise>
<IMG src="$ImagesFolder$read.gif" align="absmiddle" vspace="3"/>
</xsl:otherwise>
</xsl:choose>
<IMG src="$ImagesFolder$snippet.gif" align="absmiddle" vspace="3"/>
<xsl:variable name="itemlink" select="link"/>
<A HREF="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></A> -
<SPAN onClick="clickHandler(this)" class="SpanDetails">[璇︾粏淇℃伅]</SPAN><br/>
<DIV style="display:none; padding:4;MARGIN-LEFT:10px;background-color:whitesmoke;border-color:gray;border-width:1;border-style:solid">
<B>PubDate</B> :<xsl:value-of select="pubDate"/><br/>
<B>Description</B> :
<DIV style="padding:4;MARGIN-LEFT:0px;background-color:white;border-color:gray;border-width:1;border-style:solid"><xsl:value-of select="description" disable-output-escaping="yes"/><br/>
</DIV>
</DIV>
</DIV>
</xsl:for-each>
</DIV>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<!-- single news item -->
<xsl:template match="items">
<html xmlns:m="http://www.w3.org/1998/Math/MathML">
<head>
<title>Items</title>
<xsl:copy-of select="$common-styles"/>
<xsl:copy-of select="$common-script"/>
</head>
<body bgColor="#eeeeee" marginheight="1" marginwidth="1" language="javascript">
<table class="Title" border="0" width="100%" bgcolor="#FFFFFF" cellspacing="0" cellpadding="5">
<TR>
<TD>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
<TR>
<TD height="40" bgcolor="#EEEEEE">
<!-- channel title -->
<b><font face="Verdana" size="4">Selected Items</font></b>
<xsl:if test="image">
<xsl:variable name="imgurl" select="image/url"/>
<xsl:variable name="imgtitle" select="image/title"/>
<xsl:variable name="imglink" select="image/link"/>
<br/>
<a href="{$imglink}"><img class="channel" src="{$imgurl}" alt="{$imgtitle}" align="bottom" style="margin-top: 8px;"/></a>
</xsl:if>
</TD>
</TR>
<TR>
<TD colspan="3" height="10" bgcolor="#C0C0C0"></TD>
</TR>
</table>
</TD>
</TR>
<tr>
<td>
<DIV>
<!-- loop through each news item -->
<xsl:for-each select="item">
<DIV>
<xsl:choose>
<xsl:when test="readed='false'">
<IMG src="$ImagesFolder$unread.gif" align="absmiddle" vspace="3"/>
</xsl:when>
<xsl:otherwise>
<IMG src="$ImagesFolder$read.gif" align="absmiddle" vspace="3"/>
</xsl:otherwise>
</xsl:choose>
<IMG src="$ImagesFolder$snippet.gif" align="absmiddle" vspace="3"/>
<xsl:variable name="itemlink" select="link"/>
<A HREF="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></A> -
<SPAN onClick="clickHandler(this)" class="SpanDetails">[璇︾粏淇℃伅]</SPAN><br/>
<DIV style="display:none; padding:4;MARGIN-LEFT:10px;background-color:whitesmoke;border-color:gray;border-width:1;border-style:solid">
<B>PubDate</B> :<xsl:value-of select="pubDate"/><br/>
<B>Description</B> :
<DIV style="padding:4;MARGIN-LEFT:0px;background-color:white;border-color:gray;border-width:1;border-style:solid"><xsl:value-of select="description" disable-output-escaping="yes"/><br/>
</DIV>
</DIV>
</DIV>
</xsl:for-each>
</DIV>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -