<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<!-- document level  -->
    <xsl:template language="English" match="/">
      <html>
        <head>
          <title> <xsl:value-of select="model/title"/> </title>
		<meta http-equiv="Content-Language" content="EN-GB" />
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		
		<meta name="description" content="XML XSLT XML transformation charts Computing Engineering and Mathematical Sciences" />
		<meta name="keywords" content=" charts, XSLT, XML, transformation, Examples" />
		<meta name="author" content="SEEDS Group Faculty Information System The Faculty of Computing, Engineering and Mathematical Sciences" />
		<meta name="copyright" content="University of the West of England, Bristol" />          
		<p><a href="http://www.uwe.ac.uk"><img src="http://www.cems.uwe.ac.uk/~phale/Images/logo.gif" alt="UWE logo" width="111" height="58" border="0" /></a>
		      University of the West of England <a href="http://www.uwe.ac.uk/">Home Page</a></p> 
		      AMRC home Page <a href="http://www.cems.uwe.ac.uk/amrc/"> AMRC Home Page</a>
		      SEEDS home Page <a href="http://www.cems.uwe.ac.uk/amrc/seeds/"> SEEDS Home Page</a>
		<h2>Campus site map</h2>
		<p>Directions and Map of Campus - <a href="http://www.uwe.ac.uk/aboutUWE/campus/Frenchay.shtml">Directions and Map</a> - Multimap <a href="http://www.multimap.com/map/browse.cgi?pc=BS16%201QY">Multimap zoomable map</a></p>
		
		<h2>Web site map</h2>
		<h3>AMRC</h3>
		<p>AMRC Research <a href="http://www.cems.uwe.ac.uk/~phale/HomeSiteMapAMRC.html"> Site Map</a></p>
		<p>AMRC Text Only Site Map <a href="http://www.cems.uwe.ac.uk/~phale/HomeSiteMapAMRCTable.html"> Text Only Site Map</a></p>
		<h3>SEEDS</h3>
		<p>SEEDS Research <a href="http://www.cems.uwe.ac.uk/~phale/HomeSiteMap.html"> Site Map</a></p>
		<p>SEEDS Text Only Site Map <a href="http://www.cems.uwe.ac.uk/~phale/HomeSiteMapTable.html"> Text Only Site Map</a></p>			         
		<br />        
        </head>
        <body><xsl:attribute name="BGCOLOR"><xsl:value-of select="model/pgcolor"/></xsl:attribute>
	  <xsl:apply-templates select="model"/>
	</body>
      </html>
    </xsl:template>

<!-- model level  -->
    <xsl:template match="model">
       <TABLE border="0">
            <xsl:attribute name="width"><xsl:value-of select="maxwidth"/></xsl:attribute>
       <TR><TD ALIGN="CENTER">
       
       <IMG ALIGN="RIGHT">
         <xsl:attribute name="SRC"><xsl:value-of select="logo"/></xsl:attribute>
       </IMG>
       <H2><xsl:value-of select="title"/></H2>
       <xsl:apply-templates select="linkpage"/>
       </TD></TR></TABLE><hr/><br/><br/>

     <xsl:if test="type[.='VBAR']">
       <TABLE CELLPADDING="0" CELLSPACING="3" border="2"> 
            <xsl:attribute name="BGCOLOR"><xsl:value-of select="bckcolor"/></xsl:attribute>
            <xsl:attribute name="width"><xsl:value-of select="maxwidth"/></xsl:attribute>
       <TR><TD>
         <TABLE CELLPADDING="0" CELLSPACING="0" border="0"> 
            <xsl:attribute name="BGCOLOR"><xsl:value-of select="bckcolor"/></xsl:attribute>
            <xsl:attribute name="width"><xsl:value-of select="maxwidth"/></xsl:attribute>

          <TR><TD ALIGN="CENTER" VALIGN="BOTTOM">
              <xsl:apply-templates select="labels"/>
          </TD>

          <TD ALIGN="CENTER" VALIGN="BOTTOM">
           <TABLE CELLPADDING="0" CELLSPACING="0" border="0" width="100%"> 
            <xsl:attribute name="BGCOLOR"><xsl:value-of select="bckcolor"/></xsl:attribute>
            <xsl:attribute name="height"><xsl:value-of select="maxheight"/></xsl:attribute>
            <TR>
              <xsl:apply-templates select="bar"/>
            </TR></TABLE>
          </TD></TR>

         </TABLE>
       </TD></TR></TABLE>
      </xsl:if>

      <xsl:if test="type[.!='VBAR']">
      <xsl:if test="type[.='HBAR']">
       <TABLE CELLPADDING="0" CELLSPACING="3" border="1"> 
            <xsl:attribute name="BGCOLOR"><xsl:value-of select="bckcolor"/></xsl:attribute>
            <xsl:attribute name="width"><xsl:value-of select="maxwidth"/></xsl:attribute>
       <TR><TD>
       <TABLE CELLPADDING="0" CELLSPACING="3" border="0"> 
            <xsl:attribute name="BGCOLOR"><xsl:value-of select="bckcolor"/></xsl:attribute>
            <xsl:attribute name="width"><xsl:value-of select="maxwidth"/></xsl:attribute>

          <xsl:apply-templates select="labels"/>
          <xsl:apply-templates select="bar"/>

       </TABLE>
       </TD></TR></TABLE>
      </xsl:if>
      <xsl:if test="type[.!='HBAR']">
          unknown model type
      </xsl:if>
      </xsl:if>
	<xsl:apply-templates select="key"/>
    </xsl:template>

<!-- labels   -->

    <xsl:template match="labels">
     <xsl:if test="/model/type[.='VBAR']"> 
        <TABLE BORDER="0"> 
                <xsl:attribute name="HEIGHT"><xsl:value-of select="maxheight"/></xsl:attribute>
            <TR><xsl:attribute name="BGCOLOR"><xsl:value-of select="barcolor"/></xsl:attribute>
                <xsl:attribute name="HEIGHT"><xsl:value-of select="maxheight"/></xsl:attribute>
            <TD ALIGN="CENTER" VALIGN="MIDLE">
                <xsl:attribute name="HEIGHT"><xsl:value-of select="maxheight"/></xsl:attribute>
             <xsl:value-of select="numbers"/>
            </TD></TR><TR><xsl:attribute name="BGCOLOR"><xsl:value-of select="barcolor"/></xsl:attribute>
            <TD ALIGN="CENTER" VALIGN="BOTTOM">
              <xsl:value-of select="label"/>
        </TD></TR></TABLE>
      </xsl:if>

      <xsl:if test="/model/type[.='HBAR']">
      <TR>
        <xsl:attribute name="BGCOLOR"><xsl:value-of select="barcolor"/></xsl:attribute>
      <TD ALIGN="RIGHT" WIDTH="100">
        <FONT FACE="Arial" COLOR="Red" SIZE="+2" STYLE="BOLD">
        <xsl:value-of select="label"/></FONT>
      </TD>
      <TD ALIGN="RIGHT" WIDTH="4" BGCOLOR="BLACK">.</TD>
      <TD ALIGN="LEFT">
          <FONT FACE="Arial" COLOR="Red" SIZE="+2" STYLE="BOLD">
        <xsl:value-of select="numbers"/></FONT>
      </TD>
      </TR>
      </xsl:if>

    </xsl:template>

<!-- bars   -->

    <xsl:template match="bar"> 
     <xsl:if test="/model/type[.='VBAR']">
      <TD ALIGN="CENTER" VALIGN="BOTTOM">
        <TABLE BORDER="0" width="80%"> 
            <TR><xsl:attribute name="BGCOLOR"><xsl:value-of select="barcolor"/></xsl:attribute>
            <TD VALIGN="TOP" ALIGN="CENTER"><xsl:attribute name="HEIGHT"><xsl:value-of select="barsize"/></xsl:attribute>
             <xsl:value-of select="numbers"/>
            </TD></TR><TR><xsl:attribute name="BGCOLOR"><xsl:value-of select="bgcolor"/></xsl:attribute>
            <TD VALIGN="BOTTOM" ALIGN="CENTER">
              <xsl:value-of select="label"/>
        </TD></TR></TABLE>
      </TD>
      </xsl:if>

      <xsl:if test="/model/type[.='HBAR']">
      <TR>
      <TD ALIGN="RIGHT" WIDTH="100"> <xsl:value-of select="label"/>
      </TD>
      <TD ALIGN="RIGHT" WIDTH="4" BGCOLOR="BLACK">.</TD>
      <TD ALIGN="LEFT">
        <TABLE BORDER="0"> 
            <TR><xsl:attribute name="BGCOLOR"><xsl:value-of select="barcolor"/></xsl:attribute>
            <TD ALIGN="RIGHT"><xsl:attribute name="WIDTH"><xsl:value-of select="barsize"/></xsl:attribute>
          <xsl:value-of select="numbers"/>
        </TD></TR></TABLE>
      </TD>
      </TR>
      </xsl:if>
      
    </xsl:template>

   <xsl:template match="key">
   <TABLE BORDER="0" BGCOLOR="WHITE">
   <TR>
   <TD>
   	<xsl:value-of select="keyvalue"/> - 
   </TD>
   <TD ALIGN="LEFT">
      	<xsl:value-of select="keytext"/>
   </TD>
   </TR>
   </TABLE>
   </xsl:template>
   
   <xsl:template match="linkpage">
       
       <p>
   		<xsl:value-of select="linktext"/> - 
		<xsl:apply-templates select="linkurl"/>
   	</p>  	
    </xsl:template>

    <xsl:template match="linkurl">
   	        <xsl:element name="a">
   	       	<xsl:attribute name="href">
   		<xsl:value-of select="."/>             
   	       	</xsl:attribute>
   	       	<xsl:value-of select="."/>
                </xsl:element>
    </xsl:template>	
</xsl:stylesheet>







