[yelp-xsl] docbook: Change idkey to db.id.key and document
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] docbook: Change idkey to db.id.key and document
- Date: Thu, 26 Jan 2012 23:34:43 +0000 (UTC)
commit 33703235a51b79c8427d0555c6df5983431fd057
Author: Shaun McCance <shaunm gnome org>
Date: Thu Jan 26 17:56:13 2012 -0500
docbook: Change idkey to db.id.key and document
xslt/docbook/common/db-chunk.xsl | 2 +-
xslt/docbook/common/db-common.xsl | 11 ++++++++++-
xslt/docbook/common/db-title.xsl | 2 +-
xslt/docbook/common/db-xref.xsl | 6 +++---
xslt/docbook/html/db2html-links.xsl | 4 ++--
xslt/docbook/html/db2html-xref.xsl | 8 ++++----
6 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/xslt/docbook/common/db-chunk.xsl b/xslt/docbook/common/db-chunk.xsl
index b45599a..abde3c9 100644
--- a/xslt/docbook/common/db-chunk.xsl
+++ b/xslt/docbook/common/db-chunk.xsl
@@ -223,7 +223,7 @@ REMARK: Explain how this works
-->
<xsl:template name="db.chunk.chunk-id">
<xsl:param name="id" select="@id | @xml:id"/>
- <xsl:param name="node" select="key('idkey', $id)"/>
+ <xsl:param name="node" select="key('db.id.key', $id)"/>
<xsl:param name="depth_in_chunk">
<xsl:call-template name="db.chunk.depth-in-chunk">
<xsl:with-param name="node" select="$node"/>
diff --git a/xslt/docbook/common/db-common.xsl b/xslt/docbook/common/db-common.xsl
index 415d8f2..1d76480 100644
--- a/xslt/docbook/common/db-common.xsl
+++ b/xslt/docbook/common/db-common.xsl
@@ -31,7 +31,16 @@ This stylesheet module provides utility templates for DocBook that are
independant of the target format.
-->
-<xsl:key name="idkey" match="*" use="@id | @xml:id"/>
+
+<!--++==========================================================================
+db.id.key
+Get an element from the #{id} attribute.
+:Revision:version="3.4" date="2012-01-26" status="final"
+
+This key returns any element based on the #{id} attribute, or the #{xml:id}
+attribute in DocBook 5.
+-->
+<xsl:key name="db.id.key" match="*" use="@id | @xml:id"/>
<!--**==========================================================================
diff --git a/xslt/docbook/common/db-title.xsl b/xslt/docbook/common/db-title.xsl
index 5234a56..c84879c 100644
--- a/xslt/docbook/common/db-title.xsl
+++ b/xslt/docbook/common/db-title.xsl
@@ -61,7 +61,7 @@ use a localized automatic title if no explicit title is provided.
<xsl:with-param name="node" select="."/>
</xsl:call-template>
</xsl:variable>
- <xsl:variable name="target_chunk" select="key('idkey', $target_chunk_id)"/>
+ <xsl:variable name="target_chunk" select="key('db.id.key', $target_chunk_id)"/>
<xsl:call-template name="db.title">
<xsl:with-param name="node" select="$target_chunk"/>
</xsl:call-template>
diff --git a/xslt/docbook/common/db-xref.xsl b/xslt/docbook/common/db-xref.xsl
index 73c6938..a942638 100644
--- a/xslt/docbook/common/db-xref.xsl
+++ b/xslt/docbook/common/db-xref.xsl
@@ -69,7 +69,7 @@ REMARK: The xrefstyle/role stuff needs to be documented
-->
<xsl:template name="db.xref.content">
<xsl:param name="linkend" select="@linkend"/>
- <xsl:param name="target" select="key('idkey', $linkend)"/>
+ <xsl:param name="target" select="key('db.id.key', $linkend)"/>
<xsl:param name="xrefstyle" select="@xrefstyle"/>
<xsl:choose>
<xsl:when test="$xrefstyle = 'role:title'">
@@ -111,7 +111,7 @@ REMARK: Talk about how this works with chunking
-->
<xsl:template name="db.xref.target">
<xsl:param name="linkend" select="@linkend"/>
- <xsl:param name="target" select="key('idkey', $linkend)"/>
+ <xsl:param name="target" select="key('db.id.key', $linkend)"/>
<xsl:param name="is_chunk" select="false()"/>
<xsl:choose>
<xsl:when test="set:has-same-node($target, /*)">
@@ -145,7 +145,7 @@ REMARK: Document this
-->
<xsl:template name="db.xref.tooltip">
<xsl:param name="linkend" select="@linkend"/>
- <xsl:param name="target" select="key('idkey', $linkend)"/>
+ <xsl:param name="target" select="key('db.id.key', $linkend)"/>
<xsl:apply-templates mode="db.xref.tooltip.mode" select="$target"/>
</xsl:template>
diff --git a/xslt/docbook/html/db2html-links.xsl b/xslt/docbook/html/db2html-links.xsl
index a1810bb..29a57ce 100644
--- a/xslt/docbook/html/db2html-links.xsl
+++ b/xslt/docbook/html/db2html-links.xsl
@@ -112,8 +112,8 @@ and "Next", although the actual page titles are used for tooltips.
<xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
</xsl:call-template>
</xsl:variable>
- <xsl:variable name="prev_node" select="key('idkey', $prev_id)"/>
- <xsl:variable name="next_node" select="key('idkey', $next_id)"/>
+ <xsl:variable name="prev_node" select="key('db.id.key', $prev_id)"/>
+ <xsl:variable name="next_node" select="key('db.id.key', $next_id)"/>
<div class="links nextlinks">
<xsl:if test="$prev_id != ''">
<a class="nextlinks-prev">
diff --git a/xslt/docbook/html/db2html-xref.xsl b/xslt/docbook/html/db2html-xref.xsl
index 3756a6f..28a6b17 100644
--- a/xslt/docbook/html/db2html-xref.xsl
+++ b/xslt/docbook/html/db2html-xref.xsl
@@ -56,7 +56,7 @@ REMARK: Describe this template
-->
<xsl:template name="db2html.link" match="link">
<xsl:param name="linkend" select="@linkend"/>
- <xsl:param name="target" select="key('idkey', $linkend)"/>
+ <xsl:param name="target" select="key('db.id.key', $linkend)"/>
<a class="link">
<xsl:attribute name="href">
<xsl:call-template name="db.xref.target">
@@ -74,7 +74,7 @@ REMARK: Describe this template
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="@endterm">
- <xsl:apply-templates select="key('idkey', @endterm)/node()"/>
+ <xsl:apply-templates select="key('db.id.key', @endterm)/node()"/>
</xsl:when>
</xsl:choose>
</a>
@@ -161,7 +161,7 @@ REMARK: Describe this template
-->
<xsl:template name="db2html.xref" match="xref | db:xref">
<xsl:param name="linkend" select="@linkend"/>
- <xsl:param name="target" select="key('idkey', $linkend)"/>
+ <xsl:param name="target" select="key('db.id.key', $linkend)"/>
<xsl:param name="endterm" select="@endterm"/>
<xsl:param name="xrefstyle" select="@xrefstyle"/>
<xsl:param name="content" select="false()"/>
@@ -183,7 +183,7 @@ REMARK: Describe this template
<xsl:copy-of select="$content"/>
</xsl:when>
<xsl:when test="$endterm">
- <xsl:apply-templates select="key('idkey', $endterm)/node()"/>
+ <xsl:apply-templates select="key('db.id.key', $endterm)/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="db.xref.content">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]