<?xml version="1.0"?>
<xsl:stylesheet xsl:version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:content="http://www.underlevel.net/jordan/user-and-admin/defs#"
  xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:log="http://www.w3.org/2000/10/swap/log#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns="http://www.underlevel.net/jordan/user-and-admin/defs#">

<!--

  Ignore content for users.
  This is kind of a hacky way, maybe there's
  a better solution?

-->
<xsl:template match="//content:UserContent" />


<!--

  Format the document description.
  NOTE: XSLT provides no way of using variables in the match attribute
  of the template tag, hence the hairy hardcoded values.

-->
<xsl:template match="rdf:Description[@rdf:about]">
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><h2>Document metadata</h2><br/>
      <b><font color="red">admin-specific</font></b> content
    </td>
    <td>
      <table cellpadding="3" border="2" cellspacing="0">
        <xsl:apply-templates />
      </table>
    </td>
  </tr>
</table>
</xsl:template>

<xsl:template match="dc:title">
<tr>
  <td>
    <a href="{namespace-uri()}{local-name()}">
    <b><xsl:value-of select="local-name()"/></b>
    </a>
  </td>
  <td>
    <xsl:apply-templates />
  </td>
</tr>
</xsl:template>

<xsl:template match="dc:creator">
<tr>
  <td>
    <a href="{namespace-uri()}{local-name()}">
    <b><xsl:value-of select="local-name()"/></b>
    </a>
  </td>
  <td>
    <xsl:apply-templates />
  </td>
</tr>
</xsl:template>

<xsl:template match="rdfs:comment">
<tr>
  <td>
    <a href="{namespace-uri()}{local-name()}">
    <b><xsl:value-of select="local-name()"/></b>
    </a>
  </td>
  <td>
    <xsl:apply-templates />
  </td>
</tr>
</xsl:template>

<xsl:template match="content:Instructions">
  <h3><xsl:value-of select="@label" /></h3>
  <blockquote><div class="box"><ul><xsl:apply-templates /></ul></div>
  </blockquote>
</xsl:template>

<!--

  Format admin-related content.

-->

<xsl:template match="//content:Step">
  <li><xsl:apply-templates /></li>
</xsl:template>

<xsl:template match="//content:Content/content:Instructions/content:AdminContent">
  <b><font color="red"><xsl:apply-templates /></font></b>
</xsl:template>

</xsl:stylesheet>
