<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:param name="heading"/>
    <xsl:template match="/Result">
        <html>
            <head>
                <title>
                    <xsl:value-of select="$heading"/>
                </title>
            </head>
            <body>
                <h1>
                    <xsl:value-of select="$heading"/>
                </h1>
                <xsl:apply-templates/>
            </body>
        </html>
    </xsl:template>
    <xsl:template match="term">
        <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="name">
        <h2>
            <a href="{concat('referrers.xql?term=',.)}">
                <xsl:value-of select="."/>
            </a>
        </h2>
    </xsl:template>
    <xsl:template match="definition">
        <p id="person">
            <xsl:apply-templates/>
        </p>
    </xsl:template>
    <xsl:template match="singular">
        singular <em>
            <xsl:value-of select="."/>
        </em>
    </xsl:template>
    <xsl:template match="class">
        <h3>
            Class: <xsl:value-of select="."/>
        </h3>
    </xsl:template>
    <xsl:template match="synonym">
        or <em>
            <xsl:value-of select="."/>
        </em>
    </xsl:template>
    <xsl:template match="def">
        <a href="{concat('definition.xql?term=',.)}">
            <b>
                <xsl:value-of select="."/>
            </b>
        </a>
    </xsl:template>
    <xsl:template match="image">
        <img src="{.}"/>
    </xsl:template>
    <xsl:template match="link">
        <div>
            <a href="{href}">
                <xsl:value-of select="name"/>
            </a>
        </div>
    </xsl:template>
</xsl:stylesheet>
