diff options
Diffstat (limited to 'xhtml-1_1/chunk-common.xsl')
-rw-r--r-- | xhtml-1_1/chunk-common.xsl | 60 |
1 files changed, 37 insertions, 23 deletions
diff --git a/xhtml-1_1/chunk-common.xsl b/xhtml-1_1/chunk-common.xsl index 4d59f24..2d9ca85 100644 --- a/xhtml-1_1/chunk-common.xsl +++ b/xhtml-1_1/chunk-common.xsl @@ -1,10 +1,7 @@ -<?xml version="1.0" encoding="ASCII"?> -<!--This file was created automatically by html2xhtml--> -<!--from the HTML stylesheets.--> -<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"> +<?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><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. @@ -948,14 +945,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> @@ -980,7 +977,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 != ''"> @@ -992,7 +989,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 != ''"> @@ -1002,21 +999,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> @@ -1588,4 +1602,4 @@ </xsl:choose> </xsl:template> -</xsl:stylesheet> +</xsl:stylesheet>
\ No newline at end of file |