diff options
author | Alexander Bokovoy <ab@samba.org> | 2008-04-15 07:37:36 +0000 |
---|---|---|
committer | Gerald W. Carter <jerry@samba.org> | 2008-04-23 08:47:46 -0500 |
commit | 26dfb095bc48b43f4ecfb1c17bc3377d6c4c9375 (patch) | |
tree | d47ef5b9726e0a6b2eae1bd9000f6c6ab22dacb2 /docs/xslt/html-common.xsl | |
parent | 0d8bf911116b1fb817858c6a11073fac95a58ceb (diff) | |
download | samba-26dfb095bc48b43f4ecfb1c17bc3377d6c4c9375.tar.gz samba-26dfb095bc48b43f4ecfb1c17bc3377d6c4c9375.tar.bz2 samba-26dfb095bc48b43f4ecfb1c17bc3377d6c4c9375.zip |
Use title from a linked item to show up as text of the link if there is no endterm or content in the link itself
(This used to be commit cbf242ab8cdec36fd24d92b6855381a355a68098)
Diffstat (limited to 'docs/xslt/html-common.xsl')
-rw-r--r-- | docs/xslt/html-common.xsl | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/docs/xslt/html-common.xsl b/docs/xslt/html-common.xsl index dce900ef67..b584214cd7 100644 --- a/docs/xslt/html-common.xsl +++ b/docs/xslt/html-common.xsl @@ -1,7 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <!-- This file is generated from param.xweb; do not edit this file! --> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<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"> <xsl:param name="base.dir" select="'../htmldocs/'"/> <xsl:param name="bridgehead.in.toc" select="1"/> @@ -22,4 +25,63 @@ <xsl:template match="author"> </xsl:template> +<xsl:template match="link" name="link"> + <xsl:param name="linkend" select="@linkend"/> + <xsl:param name="a.target"/> + <xsl:param name="xhref" select="@xlink:href"/> + + <xsl:variable name="content"> + <xsl:call-template name="anchor"/> + <xsl:choose> + <xsl:when test="count(child::node()) > 0"> + <!-- If it has content, use it --> + <xsl:apply-templates/> + </xsl:when> + <!-- else look for an endterm --> + <xsl:when test="@endterm"> + <xsl:variable name="etargets" select="key('id',@endterm)"/> + <xsl:variable name="etarget" select="$etargets[1]"/> + <xsl:choose> + <xsl:when test="count($etarget) = 0"> + <xsl:message> + <xsl:value-of select="count($etargets)"/> + <xsl:text>Endterm points to nonexistent ID: </xsl:text> + <xsl:value-of select="@endterm"/> + </xsl:message> + <xsl:text>???</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$etarget" mode="endterm"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="key('id', @linkend)/title[1]"> + <xsl:call-template name="gentext.startquote"/> + <xsl:value-of select="key('id', @linkend)/title[1]"/> + <xsl:call-template name="gentext.endquote"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Link element has no content and no Endterm. And linkend's pointer has no title. </xsl:text> + <xsl:text>Nothing to show in the link to </xsl:text> + <xsl:value-of select="(@linkend)[1]"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:call-template name="simple.xlink"> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="linkend" select="$linkend"/> + <xsl:with-param name="content" select="$content"/> + <xsl:with-param name="a.target" select="$a.target"/> + <xsl:with-param name="xhref" select="$xhref"/> + </xsl:call-template> + +</xsl:template> + </xsl:stylesheet> |