]> 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:34:58 +0000 (23:34 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 5 Mar 2009 23:34:58 +0000 (23:34 +0000)
instead of question, if available. For DocBook 5, use the info versions.

xsl/fo/autotoc.xsl

index 1c55e9e610af4756ec0300ac3736757f495bd782..4d23db2972e02b34c522cffdeaad5332d5f7949e 100644 (file)
 
 <xsl:template match="question" mode="toc">
   <xsl:variable name="firstchunk">
-    <xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
+    <!-- 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">