<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions">
   <xsl:output method="html" encoding="utf-8" version="4.0" doctype-system="http://www.w3.org/TR/html4/strict.dtd"
      doctype-public="-//W3C//DTD HTML 4.01//EN"></xsl:output>

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

<xsl:template match="teiHeader"/>

<xsl:template match="div[@type='adhyāya']">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="head"/>

<xsl:template match="trailer"/>

<xsl:template match="text()"/>

<xsl:template match="div[@type='adhyāya']">
  <li>
    <a href="#{@xml:id}">
      <xsl:value-of select="@n"/><!-- adhikaraṇa !-->
      <xsl:if test="head[@type='toc']">
        <xsl:text>: </xsl:text><xsl:value-of select="head[@type='toc']"/>
      </xsl:if>
    </a>
  </li>
</xsl:template>

</xsl:stylesheet>
