<xsl:text>\fR</xsl:text>
</xsl:template>
-<xsl:template match="refsect2">
- <xsl:text> .SS "</xsl:text>
- <xsl:value-of select="title[1]"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
<xsl:template match="caution|important|note|tip|warning">
<xsl:text> .RS .Sh "</xsl:text>
<!-- capitalize word -->
<xsl:text> .RE </xsl:text>
</xsl:template>
-<xsl:template match="refsect1">
- <xsl:text> .SH "</xsl:text>
- <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
- <xsl:text>"
-</xsl:text>
+<xsl:template match="refsection|refsect1">
+ <xsl:choose>
+ <xsl:when test="ancestor::refsection">
+ <xsl:text> .SS "</xsl:text>
+ <xsl:value-of select="title[1]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> .SH "</xsl:text>
+ <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>" </xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="refsect2">
+ <xsl:text> .SS "</xsl:text>
+ <xsl:value-of select="title[1]"/>
+ <xsl:text>" </xsl:text>
<xsl:apply-templates/>
</xsl:template>