]> granicus.if.org Git - docbook-dsssl/commitdiff
applied patch #1143813 to check glossterm link before forming it.
authorBob Stayton <bobs@sagehill.net>
Mon, 8 May 2006 04:15:45 +0000 (04:15 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 8 May 2006 04:15:45 +0000 (04:15 +0000)
xsl/fo/inline.xsl

index 11b4cb5464eb6231b253b092a7e0eff9efc49c90..8d880613e620635ced5fbae435b413bfe39d0c2e 100644 (file)
 
   <xsl:choose>
     <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
-      <fo:basic-link internal-destination="{@linkend}"
-                     xsl:use-attribute-sets="xref.properties">
-        <xsl:call-template name="inline.italicseq"/>
-      </fo:basic-link>
+      <xsl:variable name="targets" select="key('id',@linkend)"/>
+      <xsl:variable name="target" select="$targets[1]"/>
+
+      <xsl:choose>
+        <xsl:when test="$target">
+          <fo:basic-link internal-destination="{@linkend}" 
+                         xsl:use-attribute-sets="xref.properties">
+            <xsl:call-template name="inline.italicseq"/>
+          </fo:basic-link>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="inline.italicseq"/>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:when>
 
     <xsl:when test="not(@linkend)