<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/TR/xpath-functions">

<xsl:template match="/">
<html>
<head>

	<title>Colin's Top Albums of 2009</title>
	<style type="text/css">
		body {
			padding:10px;
			padding-left:20px;
			font-family:Arial,Helvetica,sans-serif;
			font-size:0.9em;
		}
		a {
			color:#003366;
		}
		a:hover {
			color:#666;
			text-decoration:none;
		}
		li {
			font-weight:bold;
			color:#003366;
			font-size:3em;
			margin:20px 0;
			clear:both;
			border-bottom:solid 10px #333;
		}
		li p, li li {
			font-size:0.3em;
			font-weight:normal;
			color:#000;
			border:0;
		}
		li li {
				margin:5px 0;
			}
		.videos, .audios {
			margin:0;
			padding:0;
			width:100%;
			clear:both;
		}
		.videos li, .audios li {
			clear:none;
			margin:0 10px;
			padding:10px 0;
			list-style-type:none;
			display:none;
			width:360px;
			text-align:center;
			float:left;
		}
		li.first {
			margin:0;
			text-align:left;
			float:none;
			display:block;
		}
		.audios li {
			width:175px;
			display:block;
		}
	</style>
	
	<script language="JavaScript" type="text/javascript" src="cds.js"></script>
	<script language="JavaScript" type="text/javascript" src="music/niftyplayer.js"></script>
	
</head>

<body onload="parseCode();">

<h2>Colin's Top <xsl:value-of select="count(cds/album)"/> Albums of 2009</h2>
<p>Okay, so I have to admit that this was not the best year for music. Actually, was it the best year for anything? Maybe for crazy traveling in Canada, Costa Rica and the Western US (hey, I did that), but not for finding a damn job, having a 401k, or for finally leveling the global playing field with the rest of the developed world by getting a viable socialized medicine program. But I did want to just list the artists that had really disappointing releases this past year, all of which were on my list last year: Thao w/ the Get Down/Stay Down (bad, but not awful), Throw Me the Statue (there are like two good songs) and The Dodos (it's like he started taking thorazine.</p>
<p>On the technology side, I did this list in XSLT, a somewhat antiquated technology that doesn't really get much use today. I had never really used it, so decided to cut my teeth on it a bit, as it seemed very appropriate for this list. In all honesty, I now see why people don't use it.</p>

<hr noshade="true" width="80%" align="center" size="2"/>
<br/><br/>

<div id="playerContainer"></div>

<ol>
	<xsl:for-each select="cds/album">
		<xsl:sort select="@rank" data-type="number"/>
		<li><p><b class="artist"><xsl:value-of select="artist"/></b> - <b class="album"><xsl:value-of select="title"/></b><br/>
			<b>Released:</b>
				<xsl:choose>
				<xsl:when test="string-length(release) &gt; 3"><xsl:value-of select="concat(' ',substring(release,1,2))"/>-<xsl:value-of select="substring(release,3)"/></xsl:when>
				<xsl:otherwise><xsl:value-of select="concat(' ',substring(release,1,1))"/>-<xsl:value-of select="substring(release,2)"/></xsl:otherwise>
				</xsl:choose>
				<br/>
			<b>Label:</b> <xsl:value-of select="concat(' ',label)"/><br/>
			<b>Band Origin:</b> <xsl:value-of select="concat(' ',origin)"/><br/>
			<span class="review">
			<xsl:value-of select="review"/>
			</span></p>
			<xsl:if test="count(audio) &gt; 0">
				<ul class="audios">
					<li class="first"><img src="images/icons/listen.png" align="absmiddle" alt="Listen"/> <b>Songs for Download:</b></li>
				<xsl:for-each select="audio">
					<li>
						<span class="player"></span>
						<img src="images/icons/download.png" align="absmiddle" alt="Download"/> <a>
						<xsl:attribute name="href"><xsl:value-of select="concat(concat('/music/09/',@url),'.mp3')"/></xsl:attribute>
						<xsl:attribute name="target"><xsl:value-of select="_blank"/></xsl:attribute>
						<xsl:attribute name="title"><xsl:value-of select="Download"/></xsl:attribute>
						<xsl:value-of select="."/>
						</a>
					</li>
				</xsl:for-each>
				</ul>
			</xsl:if>
				<ul class="videos">
					<li class="first"> <br/><img src="images/icons/watch.png" align="absmiddle" alt="Watch"/> <b>Videos to Watch:</b></li>
			<xsl:choose>
			<xsl:when test="count(video) &gt; 0">
					<li class="first"><a href="javascript:void(0);" onClick="showVideos(this);">Show Videos</a></li>
					<xsl:for-each select="video">
					<li>
						<span class="video"></span>
						<a>
						<xsl:attribute name="href"><xsl:value-of select="concat('http://www.youtube.com/watch?v=',@url)"/></xsl:attribute>
						<xsl:attribute name="target">_blank</xsl:attribute>
						<xsl:attribute name="title"><xsl:value-of select="."/></xsl:attribute>
						<xsl:value-of select="."/>
						</a>
					</li>
				</xsl:for-each>
			</xsl:when>
			<xsl:otherwise>
					<li class="first">None.</li>
			</xsl:otherwise>
			</xsl:choose>
				</ul>
		</li>
	</xsl:for-each>
</ol>

</body>
</html>

</xsl:template>
</xsl:stylesheet>