]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug 1546008: in qandaentry in a TOC, use its blockinfo/titleabbrev or blockinfo...
authorBob Stayton <bobs@sagehill.net>
Thu, 5 Mar 2009 23:33:56 +0000 (23:33 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 5 Mar 2009 23:33:56 +0000 (23:33 +0000)
instead of question, if available. For DocBook 5, use the info versions.

xsl/html/qandaset.xsl

index 5037897edaac18b76a5d898aca35d7e1c3211239..6d102a0791e962ce48ecf5e42bd9d72927f594fa 100644 (file)
 
 <xsl:template match="question" mode="qandatoc.mode">
   <xsl:variable name="firstch">
-    <xsl:apply-templates select="(*[local-name(.)!='label'])[1]"/>
+    <!-- Use a titleabbrev or title if available -->
+    <xsl:choose>
+      <xsl:when test="../blockinfo/titleabbrev">
+        <xsl:apply-templates select="../blockinfo/titleabbrev[1]/node()"/>
+      </xsl:when>
+      <xsl:when test="../blockinfo/title">
+        <xsl:apply-templates select="../blockinfo/title[1]/node()"/>
+      </xsl:when>
+      <xsl:when test="../info/titleabbrev">
+        <xsl:apply-templates select="../info/titleabbrev[1]/node()"/>
+      </xsl:when>
+      <xsl:when test="../titleabbrev">
+        <xsl:apply-templates select="../titleabbrev[1]/node()"/>
+      </xsl:when>
+      <xsl:when test="../info/title">
+        <xsl:apply-templates select="../info/title[1]/node()"/>
+      </xsl:when>
+      <xsl:when test="../title">
+        <xsl:apply-templates select="../title[1]/node()"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:variable>
   <xsl:variable name="deflabel">
     <xsl:choose>