]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix formatting of glossarys--things were really broken
authorNorman Walsh <ndw@nwalsh.com>
Mon, 16 Apr 2001 13:03:22 +0000 (13:03 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 16 Apr 2001 13:03:22 +0000 (13:03 +0000)
xsl/html/glossary.xsl
xsl/html/titlepage.templates.xml

index be7c3e3f3f9e992822734f8c3ad555cb9765e2ca..91dd86dbca2dc4d0272d0fdc5510d23b16f4e50c 100644 (file)
   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
 
   <div id="{$id}" class="{name(.)}">
-    <xsl:call-template name="bibliography.titlepage"/>
-    <dl>
-      <xsl:apply-templates/>
-    </dl>
+    <xsl:call-template name="glossary.titlepage"/>
+
+    <xsl:choose>
+      <xsl:when test="glossdiv">
+        <xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:choose>
+      <xsl:when test="glossdiv">
+        <xsl:apply-templates select="glossdiv"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <dl>
+          <xsl:apply-templates select="glossentry"/>
+        </dl>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:choose>
+      <xsl:when test="glossdiv">
+        <xsl:apply-templates select="(glossdiv[1]/following-sibling::*)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="(glossentry[1]/following-sibling::*)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+
+
     <xsl:call-template name="process.footnotes"/>
   </div>
 </xsl:template>
 
 <xsl:template match="glossdiv">
   <div class="{name(.)}">
-    <xsl:apply-templates/>
+    <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
+
+    <dl>
+      <xsl:apply-templates select="glossentry"/>
+    </dl>
   </div>
 </xsl:template>
 
@@ -142,30 +174,44 @@ GlossEntry ::=
 </xsl:template>
 
 <xsl:template match="glossentry/glossdef">
-  <dd><xsl:apply-templates/></dd>
+  <dd>
+    <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
+    <xsl:if test="glossseealso">
+      <p>
+        <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"/>
+      </p>
+    </xsl:if>
+  </dd>
 </xsl:template>
 
 <xsl:template match="glossseealso">
   <xsl:variable name="otherterm" select="@otherterm"/>
   <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
   <xsl:variable name="target" select="$targets[1]"/>
-  <p>
-    <xsl:call-template name="gentext.template">
-      <xsl:with-param name="context" select="'glossary'"/>
-      <xsl:with-param name="name" select="'seealso'"/>
-    </xsl:call-template>
-    <xsl:choose>
-      <xsl:when test="@otherterm">
-        <a href="#{@otherterm}">
-          <xsl:apply-templates select="$target" mode="xref"/>
-        </a>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-    <xsl:text>.</xsl:text>
-  </p>
+
+  <xsl:choose>
+    <xsl:when test="@otherterm">
+      <a href="#{@otherterm}">
+        <xsl:apply-templates select="$target" mode="xref"/>
+      </a>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:choose>
+    <xsl:when test="position() = last()">
+      <xsl:text>.</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>, </xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <!-- ==================================================================== -->
index 30a0b6f05a8fe0bac93c290ba7f4debffe28cd59..5c01447f020ee903bc52420f47e14ca82e182784 100644 (file)
 
 <t:titlepage element="glossary" wrapper="div" class="titlepage">
   <t:titlepage-content side="recto">
-    <title predicate="[1]"/>
+    <title predicate="[1]"
+          force="1"
+          named-template="component.title"
+          param:node="ancestor-or-self::glossary[1]"/>
     <subtitle predicate="[1]"/>
   </t:titlepage-content>