]> granicus.if.org Git - docbook-dsssl/commitdiff
Make glosssee and glossseealso into full gentext templates with substitution.
authorBob Stayton <bobs@sagehill.net>
Fri, 13 May 2005 17:17:00 +0000 (17:17 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 13 May 2005 17:17:00 +0000 (17:17 +0000)
xsl/fo/glossary.xsl

index 8c2c11f0b3f379615bda489667aca630bc1ba443..7347cfdc209fd6c9ed54122320b4295ccf977382 100644 (file)
@@ -644,28 +644,37 @@ GlossEntry ::=
   <xsl:variable name="target" select="$targets[1]"/>
 
   <fo:block>
-    <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">
+          <fo:basic-link internal-destination="{$otherterm}"
+                         xsl:use-attribute-sets="xref.properties">
+            <xsl:apply-templates select="$target" mode="xref-to"/>
+          </fo:basic-link>
+        </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 mode="glossary.as.list"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="glossary.as.list"/>
+        </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">
-        <fo:basic-link internal-destination="{$otherterm}"
-                       xsl:use-attribute-sets="xref.properties">
-          <xsl:apply-templates select="$target" mode="xref-to"/>
-        </fo:basic-link>
-      </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 mode="glossary.as.list"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates mode="glossary.as.list"/>
-      </xsl:otherwise>
-    </xsl:choose>
+
     <xsl:text>.</xsl:text>
   </fo:block>
 </xsl:template>
@@ -674,11 +683,19 @@ GlossEntry ::=
   <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: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" mode="glossary.as.list"/>
+      </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" mode="glossary.as.list"/>
     </fo:block>
   </xsl:if>
 </xsl:template>
@@ -830,28 +847,37 @@ GlossEntry ::=
   <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
   <xsl:variable name="target" select="$targets[1]"/>
 
-  <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">
+        <fo:basic-link internal-destination="{$otherterm}"
+                       xsl:use-attribute-sets="xref.properties">
+          <xsl:apply-templates select="$target" mode="xref-to"/>
+        </fo:basic-link>
+      </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 mode="glossary.as.blocks"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="glossary.as.blocks"/>
+      </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">
-      <fo:basic-link internal-destination="{$otherterm}"
-                     xsl:use-attribute-sets="xref.properties">
-        <xsl:apply-templates select="$target" mode="xref-to"/>
-      </fo:basic-link>
-    </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 mode="glossary.as.blocks"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:apply-templates mode="glossary.as.blocks"/>
-    </xsl:otherwise>
-  </xsl:choose>
+
   <xsl:text>.</xsl:text>
 </xsl:template>
 
@@ -860,11 +886,19 @@ GlossEntry ::=
                        mode="glossary.as.blocks"/>
   <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: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" mode="glossary.as.blocks"/>
+      </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" mode="glossary.as.blocks"/>
     </fo:block>
   </xsl:if>
 </xsl:template>