diff options
Diffstat (limited to 'html/chunk-common.xsl')
-rw-r--r-- | html/chunk-common.xsl | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/html/chunk-common.xsl b/html/chunk-common.xsl index c65dbac..693dc03 100644 --- a/html/chunk-common.xsl +++ b/html/chunk-common.xsl @@ -7,7 +7,7 @@ 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. @@ -896,9 +896,10 @@ </xsl:when> <xsl:when test="$css.decoration != 0"> <xsl:attribute name="style"> - <xsl:value-of select="concat('width:100; align:', + <xsl:value-of select="concat('width:100; text-align:', $direction.align.start, - ';')"/> + ';', + 'margin-', $direction.align.start, ': 0')"/> </xsl:attribute> </xsl:when> <xsl:otherwise> @@ -1292,7 +1293,7 @@ <xsl:variable name="currentdoc.key" > <xsl:for-each select="$target.database" > <xsl:value-of select="key('targetdoc-key', - $current.docid)/@targetdoc" /> + $current.docid)[1]/@targetdoc" /> </xsl:for-each> </xsl:variable> <xsl:choose> @@ -1300,7 +1301,7 @@ <xsl:for-each select="$target.database" > <xsl:call-template name="targetpath" > <xsl:with-param name="dirnode" - select="key('targetdoc-key', $current.docid)/parent::dir"/> + select="key('targetdoc-key', $current.docid)[1]/parent::dir"/> <xsl:with-param name="targetdoc" select="$targetdoc"/> </xsl:call-template> </xsl:for-each > @@ -1325,7 +1326,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 != ''" > @@ -1337,7 +1338,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 != ''" > @@ -1347,24 +1348,41 @@ </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> |