<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<HTML>
			<HEAD>
				<TITLE>Jim's Movie Devotion Database</TITLE>
			</HEAD>
		<BODY>
		<xsl:apply-templates />
		</BODY>
		</HTML>
	</xsl:template>
	<xsl:template match="moviedb">
	
	<CENTER>
	<H1><xsl:value-of select="@CLASS"/></H1>

	<P style="color:#FFFFFF; background-color:#000099; font-family:ariel, helvetica, sans-serif; font-size:36pt; 
	font-weight:normal"><xsl:value-of select="opening"/></P>

	<TABLE>
		<xsl:for-each select="/moviedb/record">

		<TABLE style="border-width: medium; border-style: solid; border-color: #CCCCFF; margin-bottom:30px">

		<TR>
			<TD><xsl:apply-templates select="picture"/></TD>
		</TR>

		<TR style="color:#FFFFFF; background-color:#CC0000; font-family:ariel, helvetica, sans-serif; font-size: 24pt; 		font-weigth:normal">
			<TD><xsl:value-of select="title" /></TD>
		</TR>
		
		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weight:bold; text-align:left">
			<TH>Studio</TH>
		</TR>

		<TR>
			<TD style="padding-bottom:6pt;padding-left:3pt"><xsl:value-of select="studio" /></TD>
		</TR>

		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weight:bold; text-align:left">
			<TH>Year</TH>
		</TR>

		<TR>
			<TD style="padding-bottom:6pt;padding-left:3pt"><xsl:value-of select="year" /></TD>
		</TR>

		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weigth:bold; text-align:left">
			<TH>Director</TH>
		</TR>

		<TR valign="TOP">	
			<TD>
				<TABLE>		
					<xsl:for-each select="director">
					<TR>
						<TD style="padding-bottom:6pt;padding-left:3pt"><xsl:value-of select="firstName" />						</TD>	
						<TD style="padding-bottom:6pt;"><xsl:value-of select="lastName" /></TD>
					</TR>
					</xsl:for-each>
				</TABLE>
			</TD>
		</TR>

		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weight:bold; text-align:left">
			<TH>Cast</TH>
		</TR>

		<TR valign="TOP">			
			<TD>			
				<TABLE>
					<xsl:for-each select="cast">
					<TR>
						<TD>
							<TABLE>	
								<xsl:for-each select="actor">
								<TR>
									<TD><xsl:value-of select="firstName" /></TD>	
									<TD><xsl:value-of select="lastName" /></TD>
								</TR>
								</xsl:for-each>
							</TABLE>
						</TD>
					</TR>
					</xsl:for-each>	
				</TABLE>
			</TD>
		</TR>

		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weigth:bold; text-align:left">
			<TH>Synopsis</TH>
		</TR>

		<TR>				
			<TD style="padding-bottom:12pt;padding-left:6pt"><xsl:value-of select="synopsis" /></TD>
		</TR>
		
		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weigth:bold; text-align:left; cell-padding:12pt">
			<TH>Comments</TH>
		</TR>

		<TR>
			<TD style="padding-bottom:12pt;padding-left:6pt"><xsl:value-of select="comments" /></TD>
		</TR>

		<TR style="color:#000000; background-color:#FFFFCC; font-family=ariel, helvetica, sans-serif; font-size: 12pt; 		font-weigth:bold; text-align:left">
			<TH>Recommended Viewing</TH>
		</TR>

		<TR valign="TOP">			
			<TD>			
				<TABLE>
					<xsl:for-each select="recView">
					<TR>
						<TD>
							<TABLE>	
								<xsl:for-each select="entry">
								<TR>
									<TD><xsl:value-of select="bullet" /></TD>	
								</TR>
								</xsl:for-each>
							</TABLE>
						</TD>
					</TR>
					</xsl:for-each>	
				</TABLE>
			</TD>
		</TR>
	</TABLE>

		</xsl:for-each>
	</TABLE>
	</CENTER>

	</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="./@x"/>
    </xsl:attribute>
    <xsl:attribute name="height">
      <xsl:value-of select="./@y"/>
    </xsl:attribute>
  </img>
</xsl:template>

</xsl:stylesheet>
