]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed bug #2912677 (error with xref in title).
authorMauritz Jeanson <mj@johanneberg.com>
Sat, 20 Mar 2010 10:47:36 +0000 (10:47 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Sat, 20 Mar 2010 10:47:36 +0000 (10:47 +0000)
xsl/common/titles.xsl

index 07ec6d42588319cee0a8149915bfbbd25a318750..6d2dcb3a83a163916430970cf345849802e1fb1d 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:xlink="http://www.w3.org/1999/xlink"
                 exclude-result-prefixes="doc"
                 version='1.0'>
 
@@ -719,7 +720,7 @@ title of the element. This does not include the label.
 </xsl:template>
 
 <xsl:template match="xref" mode="no.anchor.mode">
-  <xsl:variable name="targets" select="key('id',@linkend)"/>
+  <xsl:variable name="targets" select="key('id',@linkend)|key('id',substring-after(@xlink:href,'#'))"/>
   <xsl:variable name="target" select="$targets[1]"/>
   <xsl:variable name="refelem" select="local-name($target)"/>
   
@@ -731,7 +732,8 @@ title of the element. This does not include the label.
     <xsl:when test="count($target) = 0">
       <xsl:message>
         <xsl:text>XRef to nonexistent id: </xsl:text>
-        <xsl:value-of select="@linkend"/>
+        <xsl:value-of select="@linkend"/> 
+        <xsl:value-of select="@xlink:href"/>
       </xsl:message>
       <xsl:text>???</xsl:text>
     </xsl:when>