📄 brown.xslt
字号:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:content = 'http://purl.org/rss/1.0/modules/content/'
xmlns:xhtml='http://www.w3.org/1999/xhtml'
xmlns:slash='http://purl.org/rss/1.0/modules/slash/'
xmlns:dc='http://purl.org/dc/elements/1.1/' >
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<html><head><title><xsl:value-of disable-output-escaping='yes' select='//item/title'/></title></head>
<body topmargin="0" leftmargin="0">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td valign="top" bgcolor="#333300" style="font-family: Verdana, tahoma; font-weight: bold; color: #ffcc00; font-size: medium;">
<xsl:value-of disable-output-escaping='yes' select="//item/title" />
</td>
<td bgcolor="#333300" style="font-family: Verdana, tahoma; color: #ffcc00; font-size: x-small;" align="right">
<xsl:if test="//item/category">Categories: [
<xsl:for-each select="//item/category">
<xsl:value-of select="." /><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</xsl:for-each>]
</xsl:if>
</td>
</tr>
<tr>
<td bgcolor="#333300" style="font-family: Verdana, tahoma; color: #ffcc00; font-size: small;" >
<xsl:choose>
<xsl:when test="//item/author">
<xsl:value-of select="//item/author" />
</xsl:when>
<xsl:when test="//item/dc:creator">
<xsl:value-of select="//item/dc:creator" />
</xsl:when>
</xsl:choose>
</td>
<td bgcolor="#333300" style="font-family: Verdana, tahoma; color: #ffcc00; font-size: x-small;" align="right"><xsl:value-of select="//item/pubDate" /></td>
</tr>
</table>
<div style="font-family: verdana, tahoma; padding-left: 5px; font-size: x-small;" >
<xsl:choose>
<xsl:when test="//item/xhtml:body">
<xsl:copy-of select="//item/xhtml:body"/>
</xsl:when>
<xsl:when test="//item/content:encoded">
<xsl:value-of disable-output-escaping="yes" select="//item/content:encoded" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="//item/description" />
</xsl:otherwise>
</xsl:choose>
</div>
<table width="100%">
<tr>
<td align="right" style="font-family: Verdana, tahoma; font-size: x-small;">
<a href="{//item/link}">full story</a>
</td>
</tr>
<xsl:if test='item/comments'> |
<tr>
<td align="right" style="font-family: Verdana, tahoma; font-size: x-small;">
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<xsl:text disable-output-escaping="yes"><a href='</xsl:text>
<xsl:value-of disable-output-escaping="yes" select="//item/comments" />
<xsl:text disable-output-escaping="yes">'></xsl:text>
<xsl:value-of select="//item/slash:comments"/> comment(s)
<xsl:text disable-output-escaping="yes"></a></xsl:text>
</td>
</tr>
</xsl:if>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -