]> granicus.if.org Git - docbook-dsssl/commitdiff
Patches Tracker #415439: support title attribute on HTML anchors associated with...
authorNorman Walsh <ndw@nwalsh.com>
Mon, 16 Apr 2001 13:15:14 +0000 (13:15 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 16 Apr 2001 13:15:14 +0000 (13:15 +0000)
xsl/html/xref.xsl

index 142cfadefa7d418229c1f6a2307c4ea8e8b0bec7..c367dc398daf431d0af09c5d2983f6b2744cdb8d 100644 (file)
          </xsl:when>
 
           <xsl:otherwise>
+            <xsl:attribute name="title">
+              <xsl:apply-templates select="$target" mode="xref-title"/>
+            </xsl:attribute>
+
             <xsl:apply-templates select="$target" mode="xref-to"/>
           </xsl:otherwise>
         </xsl:choose>
 
 <!-- ==================================================================== -->
 
+<xsl:template match="*" mode="xref-title">
+  <xsl:variable name="title">
+    <xsl:apply-templates select="." mode="object.title.markup"/>
+  </xsl:variable>
+
+  <xsl:value-of select="$title"/>
+</xsl:template>
+
+<xsl:template match="author" mode="xref-title">
+  <xsl:variable name="title">
+    <xsl:call-template name="person.name"/>
+  </xsl:variable>
+
+  <xsl:value-of select="$title"/>
+</xsl:template>
+
+<xsl:template match="cmdsynopsis" mode="xref-title">
+  <xsl:variable name="title">
+    <xsl:apply-templates select="(.//command)[1]" mode="xref"/>
+  </xsl:variable>
+
+  <xsl:value-of select="$title"/>
+</xsl:template>
+
+<xsl:template match="funcsynopsis" mode="xref-title">
+  <xsl:variable name="title">
+    <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
+  </xsl:variable>
+
+  <xsl:value-of select="$title"/>
+</xsl:template>
+
+<xsl:template match="biblioentry|bibliomixed" mode="xref-title">
+  <!-- handles both biblioentry and bibliomixed -->
+  <xsl:variable name="title">
+    <xsl:text>[</xsl:text>
+    <xsl:choose>
+      <xsl:when test="local-name(*[1]) = 'abbrev'">
+        <xsl:apply-templates select="*[1]"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@id"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>]</xsl:text>
+  </xsl:variable>
+
+  <xsl:value-of select="$title"/>
+</xsl:template>
+
+<xsl:template match="co" mode="xref-title">
+  <xsl:variable name="title">
+    <xsl:apply-templates select="." mode="callout-bug"/>
+  </xsl:variable>
+
+  <xsl:value-of select="$title"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
 <xsl:template match="link">
   <xsl:variable name="targets" select="id(@linkend)"/>
   <xsl:variable name="target" select="$targets[1]"/>