<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
  <html>
	<head>
		<title>CD Media in XML</title>
	</head>
  <body bgcolor="#000066" topmargin="0" leftmargin="0" marginright="0" marginwidth="5">
		<table align="center" width="90%" cellpadding="5" border="0">
	     	<xsl:for-each select="cd_media">
		<tr>
		<th align="left"><xsl:apply-templates select="picture"/></th>
		<th align="center"><p style="font-family: Georgia, Arial, serif; font-size:30 ; font-weight: normal; color: #ffffff;">CD Media in XML<br></br>by Steve</p>
			</th>
		</tr>
	     </xsl:for-each>
		</table>
	
<!-- Rockk starts here -->
<table align="center" width="95%" border="0" cellspacing="1" cellpadding="2">
      	<tr style="background-color:#ffffff; font-size: 12pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
	<th>Rock</th></tr> 
<tr style="background-color:#000000; font-size: 14pt; font-weight: bold; font-family: Georgia, Times New Roman, Times, serif; color:#ffffff;">
       		<th rowspan="2" >Picture</th>
		<th rowspan="2" >CD</th>
       		<th rowspan="2" >Artist</th>
       		<th rowspan="2" >album_title</th>
       		<th rowspan="2" >Date</th>
      	 </tr>
<tr></tr>
      <xsl:for-each select="cd_media/music/rock/cd">
        <tr style="background-color:#ffffff; font-size: 12pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
         
         <td valign="top" width="150"><xsl:apply-templates select="picture" /></td>
         <td valign="top" width="20" align="center" style="font-size: 20pt"><xsl:value-of select="cd_number" /></td>
         <td style="font-size: 14pt;" valign="top" width="50%"><xsl:value-of select="artist" /></td>        
         <td style="font-size: 14pt;" valign="top" width="50%"><xsl:value-of select="album_title/." /></td>
         <td valign="top" width="20"><xsl:value-of select="date" /></td>
       </tr>
	<tr style="background-color:#ffffff; font-size: 9pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
	<th>More Info:</th>
	<td valign="top" colspan="5"><xsl:value-of select="more_info" /></td>
	 </tr>	
      </xsl:for-each>
    </table>
<!-- Rock ends here -->
<br></br>

<!-- Punk starts here -->
<table align="center" width="100%" border="0" cellspacing="1" cellpadding="2">
      	<tr style="background-color:#ffffff; font-size: 12pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
	<th>Punk</th></tr> 
<tr style="background-color:#000000; font-size: 14pt; font-weight: bold; font-family: Georgia, Times New Roman, Times, serif; color:#ffffff;">
       		<th rowspan="2" >Picture</th>
		<th rowspan="2" >CD</th>
       		<th rowspan="2" >Artist</th>
       		<th rowspan="2" >album_title</th>
       		<th rowspan="2" >Date</th>
      	 </tr>
<tr></tr>
      <xsl:for-each select="cd_media/music/punk/cd">
        <tr style="background-color:#ffffff; font-size: 12pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
         
         <td valign="top" width="150"><xsl:apply-templates select="picture" /></td>
         <td valign="top" width="20" align="center" style="font-size: 20pt"><xsl:value-of select="cd_number" /></td>
         <td style="font-size: 14pt;" valign="top" width="50%"><xsl:value-of select="artist" /></td>        
         <td style="font-size: 14pt;" valign="top" width="50%"><xsl:value-of select="album_title/." /></td>
         <td valign="top" width="20"><xsl:value-of select="date" /></td>
       </tr>
	<tr style="background-color:#ffffff; font-size: 9pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
	<th>More Info:</th>
	<td valign="top" colspan="5"><xsl:value-of select="more_info" /></td>
	 </tr>	
      </xsl:for-each>
    </table>
<!-- Punk ends here --><br></br>
<table align="center" width="100%" border="0" cellspacing="1" cellpadding="2">
<tr style="background-color:#ffffff; font-size: 12pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
	<th>Trip-Hop</th></tr>
      	 <tr style="background-color:#000000; font-size: 14pt; font-weight: bold; font-family: Georgia, Times New Roman, Times, serif; color:#ffffff;">
       		<th rowspan="2" >Picture</th>
		<th rowspan="2" >CD</th>
       		<th rowspan="2" >Artist</th>
       		<th rowspan="2" >album_title</th>
       		<th rowspan="2" >Date</th>
      	 </tr>
<tr></tr>
      <xsl:for-each select="cd_media/music/trip_hop/cd">
        <tr style="background-color:#ffffff; font-size: 12pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
         
         <td valign="top" width="150"><xsl:apply-templates select="picture" /></td>
         <td valign="top" width="20" align="center" style="font-size: 20pt"><xsl:value-of select="cd_number" /></td>
         <td style="font-size: 14pt;" valign="top" width="50%"><xsl:value-of select="artist" /></td>        
         <td style="font-size: 14pt;" valign="top" width="50%"><xsl:value-of select="album_title/." /></td>
         <td valign="top" width="20"><xsl:value-of select="date" /></td>
       </tr>
	<tr style="background-color:#ffffff; font-size: 9pt; font-family: Georgia, Times New Roman, Times, serif; color:#000000; font-weight: bold;">
	<th>More Info:</th>
	<td valign="top" colspan="5"><xsl:value-of select="more_info" /></td>
	 </tr>	
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>


<!-- "photo" template -->
<xsl:template match="photo">
<img>
    <xsl:attribute name="src">
      <xsl:value-of select="./@photo"/>
    </xsl:attribute>
    <xsl:attribute name="width">
      <xsl:value-of select="./@y"/>
    </xsl:attribute>
    <xsl:attribute name="height">
      <xsl:value-of select="./@x"/>
    </xsl:attribute>
</img>
</xsl:template>
<!--       "picture" template         -->

<xsl:template match="picture">
  <img>
    <xsl:attribute name="src">
      <xsl:value-of select="./@filename"/>
    </xsl:attribute>
    <xsl:attribute name="width">
      <xsl:value-of select="./@y"/>
    </xsl:attribute>
    <xsl:attribute name="height">
      <xsl:value-of select="./@x"/>
    </xsl:attribute>
  </img>
</xsl:template>
</xsl:stylesheet>

