]> granicus.if.org Git - docbook-dsssl/commitdiff
Make sure a qandaset has an anchor, even when it has no title,
authorBob Stayton <bobs@sagehill.net>
Sun, 15 Mar 2009 08:30:34 +0000 (08:30 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 15 Mar 2009 08:30:34 +0000 (08:30 +0000)
because it may be referenced in a TOC or xref.
Before, the anchor was output by the title, but there was no
anchor if there was no title.

xsl/html/qandaset.xsl

index 9c551bc8994021936938681f28ee92323d536a06..30dbdb1a428962b3b14c1ce5684f07b1667b7083 100644 (file)
   <div>
     <xsl:apply-templates select="." mode="class.attribute"/>
     <xsl:apply-templates select="$title"/>
+    <xsl:if test="not($title)">
+      <!-- id is output on title if there is one -->
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+      </xsl:call-template>
+    </xsl:if>
     <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1')
                   and not(ancestor::answer and not($qanda.nested.in.toc=0))">
       <xsl:call-template name="process.qanda.toc"/>