<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="xml">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="inuit_data">
    <HTML>
      <BODY>
        <p><b><u>Data File Details</u></b></p>
        <p><b>Authority: </b><xsl:value-of select="@authority"/></p>
        <p><b>Master: </b><xsl:value-of select="@master"/></p>
        <p><b>Master URL: </b><a>
          <xsl:attribute name="href">
            <xsl:value-of select="@master_url"/>
          </xsl:attribute>
          <xsl:value-of select="@master_url"/>
        </a></p>
        <xsl:apply-templates/>
      </BODY>
    </HTML>
  </xsl:template>

  <xsl:template match="character_state">
    <table border="1" width="540">
      <td align="center" width="145">
        <table>
          <td align="center">
            <h2><xsl:value-of select="@chst_id"/></h2>
          </td>
          <tr>
          <td align="center">
            <b>Difficulty: </b><xsl:value-of select="@difficulty"/>
          </td>
          </tr>
          <tr>
            <td align="center">
              <xsl:for-each select="char">
                <b>Character Group: </b><xsl:value-of select="@ch_ref"/>
              </xsl:for-each>
            </td>
          </tr>
        </table>
      </td>
      <td align="center">
        <b>Description</b><br/><xsl:value-of select="text"/>
      </td>
      <td align="center" width="110">
        <img width="100" height="150">
           <xsl:attribute name="src">
             <xsl:value-of select="image/@src"/>
           </xsl:attribute>
           <xsl:attribute name="alt">
             <xsl:value-of select="@chst_id"/>
           </xsl:attribute>
        </img>
      </td>
    </table>
  </xsl:template>

</xsl:stylesheet>
