summaryrefslogtreecommitdiff
path: root/xslt/docbook/common/db-xref.xsl
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2005-01-20 05:43:57 +0000
committerShaun McCance <shaunm@src.gnome.org>2005-01-20 05:43:57 +0000
commit62e1406a5ce30a1f381de4b8d8d685d16da1e79e (patch)
tree7fe575cdc346c1314141564aad54721d998fa5dc /xslt/docbook/common/db-xref.xsl
parent2c1dc18189d9c7bec7942083f31878c3ea0fc50c (diff)
downloadgnome-doc-utils-62e1406a5ce30a1f381de4b8d8d685d16da1e79e.tar.gz
- Safely reference db.chunk.info_basename on db.xref.target
* xslt/docbook/common/db-xref.xsl: - Safely reference db.chunk.info_basename on db.xref.target * xslt/docbook/html/db2html-division.xsl: - Put link tags in the head
Diffstat (limited to 'xslt/docbook/common/db-xref.xsl')
-rw-r--r--xslt/docbook/common/db-xref.xsl31
1 files changed, 19 insertions, 12 deletions
diff --git a/xslt/docbook/common/db-xref.xsl b/xslt/docbook/common/db-xref.xsl
index 13ac005..861abbe 100644
--- a/xslt/docbook/common/db-xref.xsl
+++ b/xslt/docbook/common/db-xref.xsl
@@ -102,23 +102,30 @@
<xsl:template name="db.xref.target">
<xsl:param name="linkend" select="@linkend"/>
<xsl:param name="target" select="key('idkey', $linkend)"/>
- <xsl:variable name="target_chunk_id">
- <xsl:call-template name="db.chunk.chunk-id">
- <xsl:with-param name="node" select="$target"/>
- </xsl:call-template>
- </xsl:variable>
<xsl:choose>
- <xsl:when test="not($db.chunk.chunk_top) and
- string($target_chunk_id) = string(/*/@id)">
- <xsl:value-of select="concat($db.chunk.basename, $db.chunk.extension)"/>
+ <xsl:when test="$linkend = $db.chunk.info_basename">
+ <xsl:value-of select="concat($db.chunk.info_basename, $db.chunk.extension)"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="concat($target_chunk_id, $db.chunk.extension)"/>
+ <xsl:variable name="target_chunk_id">
+ <xsl:call-template name="db.chunk.chunk-id">
+ <xsl:with-param name="node" select="$target"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not($db.chunk.chunk_top) and
+ string($target_chunk_id) = string(/*/@id)">
+ <xsl:value-of select="concat($db.chunk.basename, $db.chunk.extension)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($target_chunk_id, $db.chunk.extension)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="string($target_chunk_id) != string($linkend)">
+ <xsl:value-of select="concat('#', $linkend)"/>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="string($target_chunk_id) != string($linkend)">
- <xsl:value-of select="concat('#', $linkend)"/>
- </xsl:if>
</xsl:template>