merge 602537 605199
tags 602537 + patch
kthxbye

These two bugs are actually manifestations of the same bug, and
consequently the same patch (attached) will fix them.

When looking up the template to generate a title (or, I suppose,
subtitle) from, we look up the node in the localization file that
contains contains the context that we are looking for (in the case of
605199, 'title-unnumbered').  We use a for-each to change the context
node and then determine the template node using key(), choosing the
first template node in document order.  This is the problem.  The key
function (according to the standard) is not context-sensitive, so when
we look up the first template node, we're actually getting the first
template node in the document *without regard to the context node* and
therefore (at least in English) always getting the "title" context.

My patch fixes this by instead choosing the first template node that has
the context node as its direct ancestor, which is correct.  This fixes
605199 because we're using the "title-unnumbered" context when we should
now and it fixes 602537 because we're using the "subtitle" context when
we need to instead of always forcing it to the "title" context.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
diff -ur docbook-xsl-ns.old/common/l10n.xsl docbook-xsl-ns-1.76.0~RC1+dfsg/common/l10n.xsl
--- docbook-xsl-ns.old/common/l10n.xsl	2011-01-09 23:52:13.000000000 +0000
+++ docbook-xsl-ns-1.76.0~RC1+dfsg/common/l10n.xsl	2011-01-09 23:52:58.000000000 +0000
@@ -423,7 +423,7 @@
 	  <xsl:for-each select="$context.node">
 	    <xsl:variable name="template.node"
 			  select="(key('l10n-template-style', concat($name, '#', $xrefstyle))
-				   |key('l10n-template', $name))[1]"/>
+				   |key('l10n-template', $name))[ancestor::*[1]=$context.node][1]"/>
 
 	    <xsl:choose>
 	      <xsl:when test="$template.node/@text">

Attachment: signature.asc
Description: Digital signature

Reply via email to