<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" />

<xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title><xsl:value-of select="TEI/teiHeader/fileDesc/titleStmt/title" /></title>
        </head>
        <body>
            <xsl:apply-templates select="TEI/text/body" />
        </body>
    </html>
</xsl:template>
    
    <xsl:template match="div">
        <div>
            <xsl:apply-templates/>
        </div>
    </xsl:template>
    
    <xsl:template match="head[@type='Main']">
        <h2>
            <xsl:apply-templates />
        </h2>
    </xsl:template>
    
    <xsl:template match="head[@type='Sub']">
        <h3>
            <xsl:apply-templates />
        </h3>
    </xsl:template>
    
    <xsl:template match="p">
        <p>
            <xsl:apply-templates />
        </p>
    </xsl:template>
    
    <xsl:template match="choice">
        <span>
            <xsl:attribute name="title"><xsl:value-of select="expan" /></xsl:attribute>
            <xsl:value-of select="abbr" />
        </span>
    </xsl:template>
    
    <xsl:template match="ref">
        <a>
            <xsl:attribute name="href"><xsl:value-of select="@target" /></xsl:attribute>
            <xsl:apply-templates />
        </a>
    </xsl:template>

</xsl:stylesheet>
