⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 popbox blue.xsl

📁 自己写的一个 RSS 阅读器
💻 XSL
字号:
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
<xsl:output method="html"/>
<xsl:variable name="common-styles">
	<style type="text/css">
		body {
				font-size: 100%;
				font-family: Georgia, serif;
				margin: 0;
				color: #002C4F;
				background-color: #A4D7FF;
				padding: 20px 28px; 
				filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#DDF0FF,endColorStr=#2DA3FF);
			}
			a { color: #002C4F; }
			a:hover { text-decoration: underline; }
			span.nodescription {	font-size: x-small; color: navy;}
			div.newspapertitle { text-transform: uppercase; font-weight: bold; font-size: 130%; margin-bottom: 20px;}
			div.newsitem {width: 100%; margin-bottom: 24px; margin-top: 16px }
			div.newsitemdateline { font-size: x-small; font-style: italic; }
			div.newsitemtitlebox {
	padding: 12px 14px;
	float: right;
	border: 1px solid #006FC6;
	border-right-width: 3px;
	border-bottom-width: 3px;
	margin-left: 18px;
	margin-bottom: 8px;
	text-align: right;
	width: 45%;
	background-color: #D9EDFF;
}
			div.newsitemtitlebox a { text-decoration: none; }
			div.newsitemtitle { font-weight: bold; border-bottom: 1px dotted #0074CE; padding-bottom: 8px; margin-bottom: 4px;} 
			div.newsitemcontent { line-height: 140%;  }
			hr.newsitembreak { color: #0074CE; height: 1px; }
	</style>
</xsl:variable>

<!-- channel newspaper -->
<xsl:template match="channel">
	<html xmlns:m="http://www.w3.org/1998/Math/MathML">
	<head>
		<title>Channel Newspaper</title>
		<xsl:copy-of select="$common-styles"/>
	</head>
	<body>
		<div class="newspapertitle">
			<!-- channel image -->
			<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"/>
			  <a href="{$imglink}"><img class="channel" src="{$imgurl}" alt="{$imgtitle}"/></a>
			</xsl:if>
			<!-- channel title -->
			<xsl:value-of select="title" disable-output-escaping="yes"/>
		</div>
		
		<!-- loop through each news item -->
		<xsl:for-each select="item">
		   <div class="newsitemtitle">
			  <xsl:variable name="itemlink" select="link"/>
		       <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
			</div>
			<div class="newsitemdate"><xsl:value-of select="pubDate"/></div>
			<div class="newsitemcontent">
				<xsl:value-of select="description" disable-output-escaping="yes"/>
			</div>
  		</xsl:for-each>
		
	</body>
	</html>
</xsl:template>

<!-- single news item -->
<xsl:template match="items">
	<html xmlns:m="http://www.w3.org/1998/Math/MathML">
	<head>
		<title>News Item</title>
		<xsl:copy-of select="$common-styles"/>
		<style>
			div.newspapertitle {	margin-bottom: 14px;  }
		</style>
	</head>
	<body>
		<xsl:for-each select="item">		
		   <div class="newspapertitle">
			  <xsl:variable name="itemlink" select="link"/>
		       <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
			</div>
			<div class="newsitemdate"><xsl:value-of select="pubDate"/></div>
			<div class="newsitemcontent">
				<xsl:value-of select="description" disable-output-escaping="yes"/>
				<!-- add link to comments if available -->
				<xsl:if test="comments">
					<xsl:variable name="commentlink" select="comments"/>
					<xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
					<a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="6"/></a>
				</xsl:if>
				<!-- add link to enclosure if available -->
				<xsl:if test="enclosure">
					<xsl:variable name="enclosurelink" select="enclosure/@url"/>
					<xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
					<a href="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="6"/></a>
				</xsl:if>
			</div>			
  		</xsl:for-each>
		
		<!-- channel image -->
		<xsl:if test="channel/image">
		  <xsl:variable name="imgurl" select="channel/image/url"/>
		  <xsl:variable name="imgtitle" select="channel/image/title"/>
		  <xsl:variable name="imglink" select="channel/image/link"/>
		  <a href="{$imglink}"><img class="channel" src="{$imgurl}" alt="{$imgtitle}"/></a>
		</xsl:if>
		
	</body>
	</html>
</xsl:template>

</xsl:stylesheet>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -