]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug in olink template when an olink has an id.
authorBob Stayton <bobs@sagehill.net>
Fri, 14 May 2010 03:50:38 +0000 (03:50 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 14 May 2010 03:50:38 +0000 (03:50 +0000)
Add warning message with id value when trying to link
to an element that has no generated text.

xsl/fo/xref.xsl

index d8f282a2da92ada16a83454476026312b62500c7..fb23768df53253727276024279e23a52abcf454c 100644 (file)
       </xsl:apply-templates>
     </xsl:when>
     <xsl:otherwise>
+      <xsl:if test="$verbose != 0">
+        <xsl:message>
+          <xsl:text>WARNING: xref to &lt;</xsl:text>
+          <xsl:value-of select="local-name()"/>
+          <xsl:text> id="</xsl:text>
+          <xsl:value-of select="@id|@xml:id"/>
+          <xsl:text>"&gt; has no generated text. Trying its ancestor elements.</xsl:text>
+        </xsl:message>
+      </xsl:if>
       <xsl:apply-templates select="$context" mode="xref-to">
         <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
         <xsl:with-param name="referrer" select="$referrer"/>
   <!-- olink content may be passed in from xlink olink -->
   <xsl:param name="content" select="NOTANELEMENT"/>
 
-  <xsl:call-template name="anchor"/>
-
   <xsl:variable name="localinfo" select="@localinfo"/>
 
   <xsl:choose>
         <xsl:when test="$linkend != ''">
           <fo:basic-link internal-destination="{$linkend}"
                        xsl:use-attribute-sets="xref.properties">
+            <xsl:call-template name="anchor"/>
             <xsl:copy-of select="$hottext"/>
             <xsl:copy-of select="$olink.page.citation"/>
           </fo:basic-link>
             <xsl:when test="$xep.extensions != 0">
               <fo:basic-link external-destination="url({$href})"
                              xsl:use-attribute-sets="olink.properties">
+                <xsl:call-template name="anchor"/>
                 <xsl:copy-of select="$hottext"/>
               </fo:basic-link>
               <xsl:copy-of select="$olink.page.citation"/>