<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="1.0">

  <xsl:output method="html" indent="yes"/>

  <!--
  ***************************************************************************************
    Name: Sample Presentation File
    Description: This file is a sample only.  It is used to support our sample_template.xml.

	 * ***********************************************
	 * Copyright (C) Blue Fish Development Group 2005
	 * ***********************************************
 
  ***************************************************************************************
  
<page>
	<page_title/>
	<short_description/>
	<sponsor/>
	<registration/>
	<event_date/>
	<image/>
	<section>
		<title/>
		<details/>
	</section>
	<info_table>
		<table_caption/>
		<row>
			<column>
				<author/>
			</column>
			<column>
				<description/>
			</column>	
		</row>
	</info_table>
	<related_page/>
	<disclaimer/>
</page>

  -->

<!--
***************************************************************************************
  Begin Processing the page
***************************************************************************************
-->
	
<xsl:template match="/">
	<xsl:apply-templates select="page"/>
</xsl:template>

<xsl:template match="page">

	<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
	
	<head>
		<!-- Pull out the page_title value from the xml file -->
		<title><xsl:value-of select="page_title"/></title>
		<link rel="stylesheet" type="text/css" href="/includes/styles/layout.css" />
		<link rel="stylesheet" type="text/css" href="/includes/styles/format.css" />
	</head>
	
		<body>
			<div id="container">

			<!-- Header Include File -->		
 			<xsl:text disable-output-escaping="yes"><![CDATA[<!--#include virtual="~/includes/nav/header.html" -->]]></xsl:text>

				<div id="outer_content_frame">
					<div id="left_outer_content">
						<div id="inner_content_frame">
						
						<!-- Left Navigation Include File -->
						<xsl:text disable-output-escaping="yes"><![CDATA[<!--#include virtual="~/includes/nav/communications_left_nav.html" -->]]></xsl:text>
					
							<div id="page_content">
								<div class="body_content">
									<!-- Display the page_title from the xml file -->
									<h1><xsl:value-of select="page_title"/></h1>
									
									<!-- Display the short description from the xml file -->
									<p><i><xsl:value-of select="short_description"/></i></p>
									
									<!-- Display the sponsor from the xml file -->
									<p><em>Sponsored by: </em><xsl:value-of select="sponsor"/></p>
									
				  					<!-- Display the event date from the xml file -->
									<p><em>Event Date: </em><xsl:value-of select="event_date"/></p>	
																	
									<!-- Check to determine if the registration is required-->
									<xsl:if test="registration='yes'">
								 	<p>Registration is required</p>
				  					</xsl:if>
				  					
				  					<!-- Display the image from the xml file-->
				  					<xsl:if test="not(normalize-space(image)='')">
							    		<xsl:apply-templates select="image"/>
							    	</xsl:if>
							    	
									<!-- Display the section information from the xml file-->
									<xsl:for-each select="section">
										<xsl:if test="not(normalize-space(title)='')">
											<h3><xsl:value-of select="title"/></h3>
										</xsl:if>
										<xsl:if test="not(normalize-space(details)='')">
											<xsl:copy-of select="details"/>
										</xsl:if>										
									</xsl:for-each>
									
									<!-- Display the related pages from the xml file-->
									<xsl:if test="not(normalize-space(related_page)='')">
										<a>
								    		<xsl:attribute name="href"><xsl:value-of select="related_page"/></xsl:attribute>
								    		Please see the related page
										</a>									
									</xsl:if>
									
									<!-- Display the disclaimer from the xml file-->									
									<xsl:if test="not(normalize-space(disclaimer)='')"> 
										<hr/>	
										<xsl:text disable-output-escaping="yes"><![CDATA[<!--#include virtual="~]]></xsl:text><xsl:value-of select="disclaimer"/><xsl:text disable-output-escaping="yes"><![CDATA[" -->]]></xsl:text>
										<p/>
									</xsl:if>	
									
								</div><!-- #body_content -->
							</div><!-- #page_content -->
							
							<br class="clear"/><xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
						</div><!-- #inner_content_frame -->
					</div><!-- #left_outer_content -->
					
					<div id="sidebar_container">
							
					</div><!-- #sidebar_container -->
					
					<br class="clear"/><xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
					 
				</div><!-- #outer_content_frame -->

				<!-- Footer Include File -->		
	 			<xsl:text disable-output-escaping="yes"><![CDATA[<!--#include virtual="~/includes/nav/footer.html" -->]]></xsl:text>
				
			</div><!-- #container -->
		</body>
	</html>							

</xsl:template>

<!--
***************************************************************************************
  Process the image file
***************************************************************************************
-->

<xsl:template match="image">   
	<img>
      <xsl:attribute name="src">
	 	<xsl:value-of select="."/>
      </xsl:attribute>
      <xsl:attribute name="alt"><xsl:value-of select="/page/title"/></xsl:attribute>
    </img>
 </xsl:template>

</xsl:stylesheet>