<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- create the root template -->
<xsl:template match="/">

<!-- specify how the source document will be transformed
     In this case, transform it to an HTML document
-->
<html>
  <head>
	<title>Bike Odyssey</title>
  </head>
  <body bgcolor="#FFE4E1">
    <h1 style="text-align:center;
	font-weight:bold;
	font-size:xx-large;
	font-style:italic;
	font-family:cursive;
	color:#008B8B;">
    2001 Bike Odyssey
    </h1>

    <xsl:apply-templates
            select="bike_trip/intro"/>

<!--    <xsl:apply-templates
            select="bike_trip/country_visited"/> -->

    <table align="center" width="100%" border="1"
           cellspacing="15">

    <xsl:for-each select="bike_trip/record">

    <tr>
       <td align="left"><xsl:apply-templates select="country/c_name"/></td>	
       <td align="center"><xsl:apply-templates select="country/c_website"/></td>
    </tr>

    <tr>
       <td align="left"><xsl:apply-templates select="country/c_desc"/></td>	
       <td align="right"><xsl:apply-templates select="country/c_picture"/></td>
    </tr>
 
    <tr>
     <td colspan="2">
      <table 
       style="font-size:10pt; text-align:center; 
       font-family:Arial;">
      <tr  style="background-color:#008B8B; color:#EAEAAE;">
       <th>From</th>
       <th>To</th>
       <th>Miles</th>
       <th>Climbed (ft)</th>
       <th>Hrs Rode</th>
       <th>Terrain</th>
       <th>Route</th> 
       <th>Notes</th>
      </tr>
      <tr> 
	 <xsl:apply-templates select="country/c_itinerary"/>
      </tr>
    
      </table>
     </td>
   </tr> 
    </xsl:for-each> <!-- end for-each bike_trip/record -->
    </table> 

<p> Back to: 
<xsl:apply-templates
            select="bike_trip/country_visited"/>
</p>
</body>
</html>
</xsl:template>

<!-- ******************************** Template Section ************************* -->
<!--       "intro" template             -->
<xsl:template match="intro">
  <p style="font-size:11pt; text-align:left; 
       font-family:Arial;color:#008B8B;">
	<xsl:value-of select="."/>    
  </p>
</xsl:template>

<!--       "c_desc" template             -->
<xsl:template match="c_desc">
  <p style="font-size:11pt; text-align:left; 
       font-family:Arial;color:#008B8B;">
      <xsl:value-of select="."/>
  </p>
</xsl:template>

<!--       "c_name" template             -->
<xsl:template match="c_name">
  <p style="font-weight:bold;
	font-size:x-large;
	font-style:italic;
	color:#008B8B;">
     <a>
       <xsl:attribute name="name">
          <xsl:value-of select="./@anchor"/>
       </xsl:attribute> <xsl:value-of select="."/>
     </a>
   </p>
</xsl:template>

<!--     template "c_itinerary"       -->
<xsl:template match="c_itinerary">
  <xsl:for-each select=".">
  <tr style="background-color:#FFFFF0; color:#23238E;"> 
    <td align="center"><xsl:value-of select="from_city"/></td>
    <td align="center"><xsl:value-of select="to_city"/></td>
    <td align="center"><xsl:value-of select="miles"/></td>
    <td align="center"><xsl:value-of select="ft_climbed"/></td>
    <td align="center"><xsl:value-of select="riding_time"/></td>
    <td align="center"><xsl:value-of select="terrain_desc"/></td>
    <td align="center"><xsl:value-of select="route"/></td>
    <td align="center"><xsl:value-of select="ride_notes"/></td>
   </tr>
 </xsl:for-each>
</xsl:template>

<!--       "c_picture" template         -->

<xsl:template match="c_picture">
<p style="text-align:center;">
  <img>
    <xsl:attribute name="src">
      <xsl:value-of select="./@filename"/>
    </xsl:attribute>
    <xsl:attribute name="ALT">
      <xsl:value-of select="./@ALT"/>
    </xsl:attribute>
    <xsl:attribute name="title">
      <xsl:value-of select="./@title"/>
    </xsl:attribute>
  </img>
</p>
</xsl:template>

<!--       "c_website" template   -->
<xsl:template match="c_website">
  <a>
    <xsl:attribute name="href">
       <xsl:value-of select="./@url"/>
    </xsl:attribute><xsl:value-of select="."/>
  </a>
</xsl:template>

<!--  "country_visited" template       -->
<xsl:template match="country_visited">
     <xsl:for-each select="child::node()"> 
         <a>
      	    <xsl:attribute name="href">
        	  <xsl:value-of select="./@href"/>
            </xsl:attribute>&#183;<xsl:value-of select="."/>&#183;&#160;
         </a>
	
     </xsl:for-each>	
</xsl:template>

</xsl:stylesheet>


<!--  need to add other web-sites and map -->

	
