]> granicus.if.org Git - docbook-dsssl/commitdiff
Added a template for citebiblioid. The hyperlink target is the parent of the referenc...
authorMauritz Jeanson <mj@johanneberg.com>
Fri, 21 Dec 2007 16:28:18 +0000 (16:28 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Fri, 21 Dec 2007 16:28:18 +0000 (16:28 +0000)
and the "hot text" is the biblioid itself enclosed in brackets.

xsl/fo/inline.xsl
xsl/html/inline.xsl

index e99478bd8ec11fb0a01751222f6167265513011b..01e39d7fa5a0f506de7665b1cd87c8a14575bd0c 100644 (file)
   </xsl:choose>
 </xsl:template>
 
+<xsl:template match="citebiblioid">
+  <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:choose>
+    <!-- try automatic linking based on match to parent of biblioid -->
+    <xsl:when test="$target and not(xref) and not(link)">
+
+      <xsl:text>[</xsl:text>
+      <fo:basic-link>
+        <xsl:attribute name="internal-destination">
+          <xsl:call-template name="object.id">
+            <xsl:with-param name="object" select="$target"/>
+          </xsl:call-template>
+        </xsl:attribute>
+
+       <xsl:call-template name="inline.charseq"/>
+           
+      </fo:basic-link>
+      <xsl:text>]</xsl:text>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:text>[</xsl:text>
+      <xsl:call-template name="inline.charseq"/>
+      <xsl:text>]</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="biblioentry|bibliomixed" mode="citation">
   <xsl:number from="bibliography" count="biblioentry|bibliomixed"
              level="any" format="1"/>
index b166feba3668d93c9fd8d100c6e918aedf117973..ab745b07e534eb4c5e7fe33456ca54438a5f18b7 100644 (file)
   </xsl:choose>
 </xsl:template>
 
+<xsl:template match="citebiblioid">
+  <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:choose>
+    <!-- try automatic linking based on match to parent of biblioid -->
+    <xsl:when test="$target and not(xref) and not(link)">
+
+      <xsl:text>[</xsl:text>
+      <a>
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <xsl:attribute name="href">
+          <xsl:call-template name="href.target">
+            <xsl:with-param name="object" select="$target"/>
+          </xsl:call-template>
+        </xsl:attribute>
+
+       <xsl:call-template name="inline.charseq"/>
+
+      </a>
+      <xsl:text>]</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>[</xsl:text>
+      <xsl:call-template name="inline.charseq"/>
+      <xsl:text>]</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="biblioentry|bibliomixed" mode="citation">
   <xsl:number from="bibliography" count="biblioentry|bibliomixed"
              level="any" format="1"/>