<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    
    <!--XHTML document outline--> 
    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                <title><xsl:value-of select="rss/channel/title"/></title>
                <style type="text/css">
                	body {
                		margin: 0px;
                		padding: 0px;
                		font-size: 14px;
                		font-family: "Trebuchet MS", Vardana, Arial, Helvetica, sans-serif;
                		color: #666;
                		background: #fff;
						text-align: center;
                	}
                	#container {
						margin:0 auto;
						width:750px;
                		padding: 20px;
                		border-left: 1px solid #999;
                		border-right: 1px solid #999;
						text-align: left;
                	}
                	#banner {
                		height: 60px;
                		border-bottom: 1px solid #999;
                	}
                	#banner #title {
                		margin: 0px;
                		padding: 0px;
                		float: left;
                		
                	}
                	#banner #icon {
                		float: right;
                	}
                	#content {
                		padding: 25px 10px 20px 15px;
                	}
                	#content h3 {
                		margin: 0px;
                		padding: 15px 0px 5px 0px;
                		border-bottom: 1px dotted #c00;
                	}
                	#content p {
                		margin: 0px;
                		padding: 10px 0px 10px 0px;
                	}
                	#footer {
                		text-align: center;
                		padding-top: 20px;
                		paddin-bottom: 15px;
                		border-top: 1px solid #999;
                	}
                	a {
                		color: #c00;
                		text-decoration: none;
                	}
                	a:hover {
                		color: #f00;
                	}
                </style>
			</head>
			<body>
            <div id="container">
            	<div id="banner">
            	    <xsl:apply-templates select="rss/channel" />
            	</div>
            	<div id="content">
            	    <xsl:apply-templates select="rss/channel/item" />
            	</div>
            	<div id="footer">
            	    <xsl:apply-templates select="rss/channel/copyright" />
            	</div>
            </div>
            </body>
        </html>
    </xsl:template>
    
    <!--Table headers and outline-->
    <xsl:template name="writeHeader" match="rss/channel">
        <h1>
    		<xsl:attribute name="id">title</xsl:attribute>
        	<xsl:element name="a">
        		<xsl:attribute name="href">
        			<xsl:value-of select="link" />
        		</xsl:attribute>
        		<xsl:value-of select="title"/>
        	</xsl:element>
        </h1>
    	<xsl:element name="img">
    		<xsl:attribute name="id">icon</xsl:attribute>
    		<xsl:attribute name="src">
    			<xsl:value-of select="image/url" />
    		</xsl:attribute>
    		<xsl:attribute name="alt">
    			<xsl:value-of select="image/title" />
    		</xsl:attribute>
    		<xsl:attribute name="width">
    			<xsl:value-of select="image/width" />
    		</xsl:attribute>
    		<xsl:attribute name="height">
    			<xsl:value-of select="image/height" />
    		</xsl:attribute>
    	</xsl:element>
    </xsl:template>
    
    <xsl:template name="writeContent" match="rss/channel/item">
        	<h3>
        		<xsl:element name="a">
        			<xsl:attribute name="href">
        				<xsl:value-of select="link" />
        			</xsl:attribute>
        			<xsl:attribute name="target">
        				_blank
					</xsl:attribute>
        			<xsl:value-of select="title" />
        		</xsl:element>
        	</h3>
        	<p>
        		<xsl:value-of select="description" disable-output-escaping="no" />
        	</p>
    </xsl:template>
    
    <xsl:template name="writeFooter" match="rss/channel/copyright">
        <xsl:value-of select="." />
    </xsl:template>
        
</xsl:stylesheet> 