]> granicus.if.org Git - docbook-dsssl/commitdiff
Support olinking in glosssee and glossseealso.
authorBob Stayton <bobs@sagehill.net>
Sat, 21 Mar 2009 07:48:22 +0000 (07:48 +0000)
committerBob Stayton <bobs@sagehill.net>
Sat, 21 Mar 2009 07:48:22 +0000 (07:48 +0000)
xsl/html/glossary.xsl

index 2213f1a9c34858c5a1046b0dda2ee1def4de50dd..b581fe42c4298f14fa770184c3107f401b803728 100644 (file)
@@ -4,6 +4,8 @@
 %common.entities;
 ]>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xlink='http://www.w3.org/1999/xlink'
+                exclude-result-prefixes="xlink"
                 version='1.0'>
 
 <!-- ********************************************************************
@@ -235,6 +237,7 @@ GlossEntry ::=
   <xsl:variable name="otherterm" select="@otherterm"/>
   <xsl:variable name="targets" select="key('id', $otherterm)"/>
   <xsl:variable name="target" select="$targets[1]"/>
+  <xsl:variable name="xlink" select="@xlink:href"/>
 
   <dd>
     <p>
@@ -258,6 +261,13 @@ GlossEntry ::=
               <xsl:apply-templates select="$target" mode="xref-to"/>
             </a>
           </xsl:when>
+          <xsl:when test="$xlink">
+            <xsl:call-template name="simple.xlink">
+              <xsl:with-param name="content">
+                <xsl:apply-templates/>
+              </xsl:with-param>
+            </xsl:call-template>
+          </xsl:when>
           <xsl:when test="$otherterm != '' and not($target)">
             <xsl:message>
               <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
@@ -307,6 +317,7 @@ GlossEntry ::=
   <xsl:variable name="otherterm" select="@otherterm"/>
   <xsl:variable name="targets" select="key('id', $otherterm)"/>
   <xsl:variable name="target" select="$targets[1]"/>
+  <xsl:variable name="xlink" select="@xlink:href"/>
 
   <xsl:choose>
     <xsl:when test="$target">
@@ -320,6 +331,13 @@ GlossEntry ::=
         <xsl:apply-templates select="$target" mode="xref-to"/>
       </a>
     </xsl:when>
+    <xsl:when test="$xlink">
+      <xsl:call-template name="simple.xlink">
+        <xsl:with-param name="content">
+          <xsl:apply-templates/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
     <xsl:when test="$otherterm != '' and not($target)">
       <xsl:message>
         <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>