<!-- ==================================================================== -->
<!-- handle subsections (lower level headings) -->
<!-- ==================================================================== -->
-<xsl:template match="section/section">
+<xsl:template match="section/section" priority="3">
<!-- Section heading -->
<h3>
<xsl:choose>
<!-- ==================================================================== -->
<!-- handle subsubsections (h4) -->
<!-- ==================================================================== -->
-<xsl:template match="section/section/section">
+<xsl:template match="section/section/section" priority="4">
<!-- Section heading -->
<h4>
<xsl:choose>
</xsl:variable>
<xsl:choose>
+ <!-- No link if within the block that describe the directive itself -->
+ <xsl:when test="$in-modulesynopsis and normalize-space(.) = ../../name">
+ <xsl:if test="@type='section'"><</xsl:if>
+ <xsl:value-of select="."/>
+ <xsl:if test="@type='section'">></xsl:if>
+ <xsl:message>Candidate (remove ref): <xsl:value-of select="."/></xsl:message>
+ </xsl:when>
+ <xsl:when test="$in-modulesynopsis and normalize-space(.) = ../../../name">
+ <xsl:if test="@type='section'"><</xsl:if>
+ <xsl:value-of select="."/>
+ <xsl:if test="@type='section'">></xsl:if>
+ <xsl:message>Candidate (remove ref): <xsl:value-of select="."/></xsl:message>
+ </xsl:when>
+ <xsl:when test="$in-modulesynopsis and normalize-space(.) = ../../../../name">
+ <xsl:if test="@type='section'"><</xsl:if>
+ <xsl:value-of select="."/>
+ <xsl:if test="@type='section'">></xsl:if>
+ <xsl:message>Candidate (remove ref): <xsl:value-of select="."/></xsl:message>
+ </xsl:when>
+ <xsl:when test="$in-modulesynopsis and normalize-space(.) = ../../../../../name">
+ <xsl:if test="@type='section'"><</xsl:if>
+ <xsl:value-of select="."/>
+ <xsl:if test="@type='section'">></xsl:if>
+ <xsl:message>Candidate (REMOVE ref): <xsl:value-of select="."/></xsl:message>
+ </xsl:when>
<xsl:when test="$in-modulesynopsis and normalize-space(@module) = /modulesynopsis/name">
<a href="#{$lowerdirective}">
<xsl:if test="@type='section'"><</xsl:if>
</xsl:choose>
</xsl:when>
+ <!-- Missing module reference -->
+ <xsl:when test="$in-modulesynopsis and normalize-space(.) != ../../../name">
+ <xsl:if test="@type='section'"><</xsl:if>
+ <xsl:value-of select="."/>
+ <xsl:if test="@type='section'">></xsl:if>
+ <xsl:message>Candidate (ADD ref): <xsl:value-of select="."/></xsl:message>
+ </xsl:when>
<xsl:otherwise>
<xsl:if test="@type='section'"><</xsl:if>
<xsl:value-of select="."/>