]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #574840: fix bug where some symbol index terms got lost
authorNorman Walsh <ndw@nwalsh.com>
Mon, 8 Jul 2002 14:56:51 +0000 (14:56 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 8 Jul 2002 14:56:51 +0000 (14:56 +0000)
xsl/fo/autoidx.xsl
xsl/html/autoidx.xsl

index 4441f33dbc488f00a8555a1eab5f223eb15d2d74..6025c2e11cb2b6ff725d95b6501991793f0de05c 100644 (file)
       <fo:block>
         <xsl:apply-templates select="$others[count(.|key('primary',
                                      &primary;)[1]) = 1]"
-                             mode="index-primary">
+                             mode="index-symbol-div">
           <xsl:sort select="&primary;"/>
         </xsl:apply-templates>
       </fo:block>
 <xsl:template match="indexterm" mode="index-div">
   <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
   <fo:block>
-    <!-- this isn't quite exactly right. ideally all the symbols would -->
-    <!-- be grouped together. as it stands, they all get separate divs -->
-    <!-- but at least this test makes sure that they don't all get     -->
-    <!-- separate titles as well. -->
     <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
       <fo:block font-size="16pt"
                 font-weight="bold"
   </fo:block>
 </xsl:template>
 
+<xsl:template match="indexterm" mode="index-symbol-div">
+  <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+
+  <fo:block>
+    <xsl:apply-templates select="key('letter', $key)[count(.|key('primary', &primary;)[1]) = 1]"
+                         mode="index-primary">
+      <xsl:sort select="&primary;"/>
+    </xsl:apply-templates>
+  </fo:block>
+</xsl:template>
+
 <xsl:template match="indexterm" mode="index-primary">
   <xsl:variable name="key" select="&primary;"/>
   <xsl:variable name="refs" select="key('primary', $key)"/>
index 076451a5631d4432bd031ec979567b98934ce0b4..7b3a3fe512c29927ab6070c7e032ecfe177118e0 100644 (file)
         <dl>
           <xsl:apply-templates select="$others[count(.|key('primary',
                                        &primary;)[1]) = 1]"
-                               mode="index-primary">
+                               mode="index-symbol-div">
             <xsl:sort select="&primary;"/>
           </xsl:apply-templates>
         </dl>
   </div>
 </xsl:template>
 
+<xsl:template match="indexterm" mode="index-symbol-div">
+  <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+  <xsl:apply-templates select="key('letter', $key)[count(.|key('primary', &primary;)[1]) = 1]"
+                       mode="index-primary">
+    <xsl:sort select="&primary;"/>
+  </xsl:apply-templates>
+</xsl:template>
+
 <xsl:template match="indexterm" mode="index-primary">
   <xsl:variable name="key" select="&primary;"/>
   <xsl:variable name="refs" select="key('primary', $key)"/>