<?xml version='1.0'?>

<xsl:stylesheet version="2.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:csc="http://csclub.uwaterloo.ca/xslt">

<xsl:template match="execlist">
  <h3>Elected positions</h3>
  <ul>
    <xsl:apply-templates select="exec[@type='elected']" />
  </ul>
  <h3>Appointed positions</h3>
  <ul>
    <xsl:apply-templates select="exec[@type='appointed']" />
  </ul>
</xsl:template>

<xsl:template match="exec">
  <li>
    <xsl:value-of select="@name" /> is this term's <b>
    <xsl:value-of select="@position" /></b>. You can <a 
    href="mailto:{@userid}@csclub.uwaterloo.ca">e-mail the 
    <xsl:value-of select="@position" /></a>
    <xsl:if test="not(@href='')">
      or <a href="{@href}">visit 
      <xsl:choose>
        <xsl:when test="@sex='male'"> his </xsl:when>
        <xsl:when test="@sex='female'"> her </xsl:when>
        <xsl:otherwise> his or her </xsl:otherwise>
      </xsl:choose>
      homepage</a>
    </xsl:if>.
  </li>
</xsl:template>

</xsl:stylesheet>
