From: <mz...@us...> - 2007-12-21 16:33:12
|
Revision: 7622 http://docbook.svn.sourceforge.net/docbook/?rev=7622&view=rev Author: mzjn Date: 2007-12-21 08:28:18 -0800 (Fri, 21 Dec 2007) Log Message: ----------- Added a template for citebiblioid. The hyperlink target is the parent of the referenced biblioid, and the "hot text" is the biblioid itself enclosed in brackets. Modified Paths: -------------- trunk/xsl/fo/inline.xsl trunk/xsl/html/inline.xsl Modified: trunk/xsl/fo/inline.xsl =================================================================== --- trunk/xsl/fo/inline.xsl 2007-12-19 21:23:30 UTC (rev 7621) +++ trunk/xsl/fo/inline.xsl 2007-12-21 16:28:18 UTC (rev 7622) @@ -1129,6 +1129,36 @@ </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"/> Modified: trunk/xsl/html/inline.xsl =================================================================== --- trunk/xsl/html/inline.xsl 2007-12-19 21:23:30 UTC (rev 7621) +++ trunk/xsl/html/inline.xsl 2007-12-21 16:28:18 UTC (rev 7622) @@ -1296,6 +1296,36 @@ </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"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |