diff options
Diffstat (limited to 'xhtml/chunk-common.xsl')
-rw-r--r-- | xhtml/chunk-common.xsl | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/xhtml/chunk-common.xsl b/xhtml/chunk-common.xsl index ac90cd0..89e2de5 100644 --- a/xhtml/chunk-common.xsl +++ b/xhtml/chunk-common.xsl @@ -4,7 +4,7 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="exsl cf ng db"> <!-- ******************************************************************** - $Id: chunk-common.xsl 9362 2012-05-12 23:41:56Z bobstayton $ + $Id: chunk-common.xsl 9717 2013-01-25 18:13:36Z bobstayton $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. @@ -605,7 +605,7 @@ </xsl:when> <xsl:when test="$css.decoration != 0"> <xsl:attribute name="style"> - <xsl:value-of select="concat('width:100; align:', $direction.align.start, ';')"/> + <xsl:value-of select="concat('width:100; text-align:', $direction.align.start, ';', 'margin-', $direction.align.start, ': 0')"/> </xsl:attribute> </xsl:when> <xsl:otherwise> @@ -963,14 +963,14 @@ <!-- Was it found in the database? --> <xsl:variable name="currentdoc.key"> <xsl:for-each select="$target.database"> - <xsl:value-of select="key('targetdoc-key', $current.docid)/@targetdoc"/> + <xsl:value-of select="key('targetdoc-key', $current.docid)[1]/@targetdoc"/> </xsl:for-each> </xsl:variable> <xsl:choose> <xsl:when test="$currentdoc.key != ''"> <xsl:for-each select="$target.database"> <xsl:call-template name="targetpath"> - <xsl:with-param name="dirnode" select="key('targetdoc-key', $current.docid)/parent::dir"/> + <xsl:with-param name="dirnode" select="key('targetdoc-key', $current.docid)[1]/parent::dir"/> <xsl:with-param name="targetdoc" select="$targetdoc"/> </xsl:call-template> </xsl:for-each> @@ -995,7 +995,7 @@ <!-- In either case, add baseuri from its document entry--> <xsl:variable name="docbaseuri"> <xsl:for-each select="$target.database"> - <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri"/> + <xsl:value-of select="key('targetdoc-key', $targetdoc)[1]/@baseuri"/> </xsl:for-each> </xsl:variable> <xsl:if test="$docbaseuri != ''"> @@ -1007,7 +1007,7 @@ <!-- Just use any baseuri from its document entry --> <xsl:variable name="docbaseuri"> <xsl:for-each select="$target.database"> - <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri"/> + <xsl:value-of select="key('targetdoc-key', $targetdoc)[1]/@baseuri"/> </xsl:for-each> </xsl:variable> <xsl:if test="$docbaseuri != ''"> @@ -1017,21 +1017,38 @@ </xsl:choose> </xsl:variable> - <!-- Form the href information --> - <xsl:if test="not(contains($baseuri, ':'))"> - <!-- if not an absolute uri, add upward path from olink chunk --> - <xsl:value-of select="$upward.from.path"/> - </xsl:if> + <!-- Is this olink to be active? --> + <xsl:variable name="active.olink"> + <xsl:choose> + <xsl:when test="$activate.external.olinks = 0"> + <xsl:choose> + <xsl:when test="$current.docid = ''">1</xsl:when> + <xsl:when test="$targetdoc = ''">1</xsl:when> + <xsl:when test="$targetdoc = $current.docid">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:variable> - <xsl:if test="$baseuri != ''"> - <xsl:value-of select="$baseuri"/> - <xsl:if test="substring($target.href,1,1) != '#'"> - <!--xsl:text>/</xsl:text--> + <xsl:if test="$active.olink != 0"> + <!-- Form the href information --> + <xsl:if test="not(contains($baseuri, ':'))"> + <!-- if not an absolute uri, add upward path from olink chunk --> + <xsl:value-of select="$upward.from.path"/> + </xsl:if> + + <xsl:if test="$baseuri != ''"> + <xsl:value-of select="$baseuri"/> + <xsl:if test="substring($target.href,1,1) != '#'"> + <!--xsl:text>/</xsl:text--> + </xsl:if> + </xsl:if> + <!-- optionally turn off frag for PDF references --> + <xsl:if test="not($insert.olink.pdf.frag = 0 and translate(substring($baseuri, string-length($baseuri) - 3), 'PDF', 'pdf') = '.pdf' and starts-with($target.href, '#') )"> + <xsl:value-of select="$target.href"/> </xsl:if> - </xsl:if> - <!-- optionally turn off frag for PDF references --> - <xsl:if test="not($insert.olink.pdf.frag = 0 and translate(substring($baseuri, string-length($baseuri) - 3), 'PDF', 'pdf') = '.pdf' and starts-with($target.href, '#') )"> - <xsl:value-of select="$target.href"/> </xsl:if> </xsl:if> </xsl:template> |