]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #577798: glossentry with multiple glossdefs creates broken FO
authorNorman Walsh <ndw@nwalsh.com>
Mon, 21 Oct 2002 12:50:07 +0000 (12:50 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 21 Oct 2002 12:50:07 +0000 (12:50 +0000)
xsl/fo/glossary.xsl

index c98e8fcda115e520e22e640ca1838ed807ee224c..b10f7d63226e79ece72ec90e07091211d479d394 100644 (file)
@@ -530,16 +530,22 @@ GlossEntry ::=
         </xsl:choose>
       </xsl:with-param>
     </xsl:call-template>
-    <xsl:apply-templates mode="glossary.as.list"/>
+
+    <fo:list-item-label end-indent="label-end()">
+      <fo:block>
+        <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
+        <xsl:apply-templates select="indexterm"/>
+      </fo:block>
+    </fo:list-item-label>
+
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.list"/>
+    </fo:list-item-body>
   </fo:list-item>
 </xsl:template>
 
 <xsl:template match="glossentry/glossterm" mode="glossary.as.list">
-  <fo:list-item-label end-indent="label-end()">
-    <fo:block>
-      <xsl:apply-templates/>
-    </fo:block>
-  </fo:list-item-label>
+  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="glossentry/acronym" mode="glossary.as.list">
@@ -555,38 +561,35 @@ GlossEntry ::=
   <xsl:variable name="otherterm" select="@otherterm"/>
   <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
   <xsl:variable name="target" select="$targets[1]"/>
-  <fo:list-item-body start-indent="body-start()">
+
+  <fo:block>
+    <xsl:call-template name="gentext.template">
+      <xsl:with-param name="context" select="'glossary'"/>
+      <xsl:with-param name="name" select="'see'"/>
+    </xsl:call-template>
+    <xsl:choose>
+      <xsl:when test="@otherterm">
+        <xsl:apply-templates select="$target" mode="xref"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="glossary.as.list"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>.</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="glossentry/glossdef" mode="glossary.as.list">
+  <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
+  <xsl:if test="glossseealso">
     <fo:block>
       <xsl:call-template name="gentext.template">
         <xsl:with-param name="context" select="'glossary'"/>
-        <xsl:with-param name="name" select="'see'"/>
+        <xsl:with-param name="name" select="'seealso'"/>
       </xsl:call-template>
-      <xsl:choose>
-        <xsl:when test="@otherterm">
-          <xsl:apply-templates select="$target" mode="xref"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates mode="glossary.as.list"/>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:text>.</xsl:text>
+      <xsl:apply-templates select="glossseealso" mode="glossary.as.list"/>
     </fo:block>
-  </fo:list-item-body>
-</xsl:template>
-
-<xsl:template match="glossentry/glossdef" mode="glossary.as.list">
-  <fo:list-item-body start-indent="body-start()">
-    <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
-    <xsl:if test="glossseealso">
-      <fo:block>
-        <xsl:call-template name="gentext.template">
-          <xsl:with-param name="context" select="'glossary'"/>
-          <xsl:with-param name="name" select="'seealso'"/>
-        </xsl:call-template>
-        <xsl:apply-templates select="glossseealso" mode="glossary.as.list"/>
-      </fo:block>
-    </xsl:if>
-  </fo:list-item-body>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"