]> granicus.if.org Git - docbook-dsssl/commitdiff
Moved the raw.help.title and help.title variables to the hhp-main template to make...
authorMauritz Jeanson <mj@johanneberg.com>
Wed, 15 Aug 2007 10:44:03 +0000 (10:44 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Wed, 15 Aug 2007 10:44:03 +0000 (10:44 +0000)
a value is assigned after the namespace-stripping has been done. This prevents "Request
for title of element with no title" errors.

Added "//db:indexterm[1]|//ng:indexterm[1]" to the select expression of the global
htmlhelp.generate.index parameter, so that an index can be built for both DB 4 and
DB 5/NG documents (it's a little ugly, but a value needs to be assigned somehow).

xsl/htmlhelp/htmlhelp-common.xsl

index ab87babc2bb229fa743b9ad95e9bc012ad3f522d..2064dea46be9523867752e59b93dd9f82e415c9d 100644 (file)
 
 <!-- ==================================================================== -->
 
-<xsl:param name="htmlhelp.generate.index" select="//indexterm[1]"/>
-
+<xsl:param name="htmlhelp.generate.index" select="//indexterm[1]|//db:indexterm[1]|//ng:indexterm[1]"/>
+  
 <!-- Set up HTML Help flag -->
 <xsl:variable name="htmlhelp.output" select="1"/>
 
-<xsl:variable name="raw.help.title">
-  <xsl:choose>
-    <xsl:when test="$htmlhelp.title = ''">
-      <xsl:choose>
-        <xsl:when test="$rootid != ''">
-          <xsl:apply-templates select="key('id',$rootid)" mode="title.markup"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="/*" mode="title.markup"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="$htmlhelp.title"/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:variable>
-
-<xsl:variable name="help.title" select="normalize-space($raw.help.title)"/>
-  
 <!-- ==================================================================== -->
 
 <xsl:template match="/">
+
   <!-- * Get a title for current doc so that we let the user -->
   <!-- * know what document we are processing at this point. -->
   <xsl:variable name="doc.title">
 
 <!-- ==================================================================== -->
 <xsl:template name="hhp-main">
+
+  <xsl:variable name="raw.help.title">
+    <xsl:choose>
+      <xsl:when test="$htmlhelp.title = ''">
+       <xsl:choose>
+         <xsl:when test="$rootid != ''">
+           <xsl:apply-templates select="key('id',$rootid)" mode="title.markup"/>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:apply-templates select="/*" mode="title.markup"/>
+         </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:value-of select="$htmlhelp.title"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="help.title" select="normalize-space($raw.help.title)"/>
+  
 <xsl:variable name="default.topic">
   <xsl:choose>
     <xsl:when test="$htmlhelp.default.topic != ''">