]> granicus.if.org Git - docbook-dsssl/commitdiff
Now glosssee and glossseealso use full gentext template with substitution.
authorBob Stayton <bobs@sagehill.net>
Fri, 13 May 2005 17:23:42 +0000 (17:23 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 13 May 2005 17:23:42 +0000 (17:23 +0000)
xsl/html/glossary.xsl

index c196805badca8b1160417a232bbb9aa32849382e..afad5f84749cba8ad4f2893e1c2328bd9bed44f1 100644 (file)
@@ -187,32 +187,42 @@ GlossEntry ::=
 
   <dd>
     <p>
-      <xsl:call-template name="gentext.template">
-        <xsl:with-param name="context" select="'glossary'"/>
-        <xsl:with-param name="name" select="'see'"/>
+      <xsl:variable name="template">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'glossary'"/>
+          <xsl:with-param name="name" select="'see'"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="title">
+        <xsl:choose>
+          <xsl:when test="$target">
+            <a>
+              <xsl:attribute name="href">
+                <xsl:call-template name="href.target">
+                  <xsl:with-param name="object" select="$target"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:apply-templates select="$target" mode="xref-to"/>
+            </a>
+          </xsl:when>
+          <xsl:when test="$otherterm != '' and not($target)">
+            <xsl:message>
+              <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
+              <xsl:value-of select="$otherterm"/>
+            </xsl:message>
+            <xsl:apply-templates/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:call-template name="substitute-markup">
+        <xsl:with-param name="template" select="$template"/>
+        <xsl:with-param name="title" select="$title"/>
       </xsl:call-template>
-      <xsl:choose>
-        <xsl:when test="$target">
-          <a>
-            <xsl:attribute name="href">
-              <xsl:call-template name="href.target">
-                <xsl:with-param name="object" select="$target"/>
-              </xsl:call-template>
-            </xsl:attribute>
-            <xsl:apply-templates select="$target" mode="xref-to"/>
-          </a>
-        </xsl:when>
-        <xsl:when test="$otherterm != '' and not($target)">
-          <xsl:message>
-            <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
-            <xsl:value-of select="$otherterm"/>
-          </xsl:message>
-          <xsl:apply-templates/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates/>
-        </xsl:otherwise>
-      </xsl:choose>
       <xsl:text>.</xsl:text>
     </p>
   </dd>
@@ -223,11 +233,19 @@ GlossEntry ::=
     <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:variable name="template">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'glossary'"/>
+            <xsl:with-param name="name" select="'seealso'"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:variable name="title">
+          <xsl:apply-templates select="glossseealso"/>
+        </xsl:variable>
+        <xsl:call-template name="substitute-markup">
+          <xsl:with-param name="template" select="$template"/>
+          <xsl:with-param name="title" select="$title"/>
         </xsl:call-template>
-        <xsl:apply-templates select="glossseealso"/>
       </p>
     </xsl:if>
   </dd>