<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>PrimEx Bank Definitions</TITLE>
</HEAD>
<BODY>
<H1>Primex Bank Definitions</H1>
<xsl:apply-templates/>
</BODY>
</HTML>
</xsl:template>

<xsl:template match="//bank">
<H2>bank: <xsl:value-of select="@name"/></H2>
<xsl:apply-templates select="bankflag"/>
<xsl:choose>
  <xsl:when test="@typedef">
    <P>Use members of non-"bank" structure named in <xsl:value-of select="@typedef"/>.</P>
  </xsl:when>
  <xsl:when test="@rowdef">
    <P>Use members of structure <xsl:value-of select="@rowdef"/>.</P>
  </xsl:when>
  <xsl:otherwise>
    <TABLE BORDER="1">
    <TH>Name</TH><TH>Type</TH><TH>Comment</TH>
    <xsl:apply-templates select="column"/>
    </TABLE>
  </xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="//bank/bankflag">
bankflag = <xsl:value-of select="."/><br/>
</xsl:template>

<xsl:template match="//bank/column">
<TR>
<TD><xsl:value-of select="@name"/></TD>
<TD><xsl:value-of select="@type"/></TD>
<TD><xsl:value-of select="@comment"/>
<xsl:if test="@default">
-- default = <xsl:value-of select="@default"/>
</xsl:if>
</TD>
</TR>
</xsl:template>

<xsl:template match="//struct">
<H2>structure: <xsl:value-of select="@name"/></H2>
<TABLE BORDER="1">
<TH>Name</TH><TH>Type</TH><TH>Comment</TH>
<xsl:apply-templates/>
</TABLE>
</xsl:template>

<xsl:template match="//struct/member">
<TR>
<TD><xsl:value-of select="@name"/></TD>
<TD><xsl:value-of select="@type"/></TD>
<TD><xsl:value-of select="@comment"/></TD>
</TR>
</xsl:template>

<xsl:template match="//CVSID">
<hr></hr>
<pre>
CVS: <xsl:value-of select="."/>
</pre>
</xsl:template>

</xsl:stylesheet>
