<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <xsl:output method="html"/>

  <xsl:template match="page">

    <html>
    <head>
      <link rel="stylesheet" type="text/css" href="translator.css"/>
      <title>{<xsl:value-of select="title"/>}</title>
    </head>
    <body bgcolor="#ffffff">
      <h3 style="color: navy; text-align: center"><xsl:value-of select="title"/></h3>
      <xsl:apply-templates/>
    </body>
    </html>
  </xsl:template>

  <xsl:template match="em">
    <strong><xsl:apply-templates/></strong>
  </xsl:template>

  <xsl:template match="language-list">
    <xsl:if test="@format='table'">
      <table border="1" align="left">
        <xsl:for-each select="language">
          <tr>
          <td valign="top"><img src="img/{@code}.gif"/></td>
          <td valign="top">
	    <xsl:value-of select="@name"/>
	  </td>
        </tr>
        </xsl:for-each>
      </table>
    </xsl:if>
    <xsl:if test="@format='selection'">
      &#160;
      <select name="sourceLanguage" size="1">
        <xsl:for-each select="language">
          <option value="{@code}"><xsl:value-of select="@name"/></option>
        </xsl:for-each>
      </select>
    </xsl:if>
  </xsl:template>

  <xsl:template match="translation">
    <center>
    <table border="1">

      <tr>
	<th></th>
        <xsl:for-each select="meaning[1]/language">
	  <th>
	    <img src="img/{@code}.gif"/><hr/>
	    <xsl:value-of select="@name"/>
	  </th>
        </xsl:for-each>
      </tr>

      <xsl:for-each select="meaning">
        <tr>
          <td valign="top">
            <center>
	      <xsl:value-of select="@term-type"/><br/>
	      (<i><xsl:value-of select="@reference-term"/></i>)
	    </center>
          </td>
          <xsl:for-each select="language">
            <td valign="top">
              <xsl:for-each select="term">
                <xsl:value-of select="@value"/><br/>
              </xsl:for-each>
	      &#160;
            </td>
	  </xsl:for-each>
        </tr>
      </xsl:for-each>
    </table>
    </center>
  </xsl:template>
    
  <xsl:template match="input">
    &#160;
    <xsl:copy>
      <xsl:apply-templates select="input|@*"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="@*|*|text()|processing-instruction()">
    <xsl:copy>
      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
