]> granicus.if.org Git - docbook-dsssl/commitdiff
Handles missing otherterm targets in glosssee and glossseealso.
authorBob Stayton <bobs@sagehill.net>
Fri, 13 Dec 2002 09:53:45 +0000 (09:53 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 13 Dec 2002 09:53:45 +0000 (09:53 +0000)
xsl/html/glossary.xsl

index 2b4139b47bcd8ffaa59a9f6e9c9c1ebdf83711c2..e7d5c0e79a84aaf0dcca3e5844d1e41bdbaa109e 100644 (file)
@@ -144,6 +144,7 @@ GlossEntry ::=
   <xsl:variable name="otherterm" select="@otherterm"/>
   <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
   <xsl:variable name="target" select="$targets[1]"/>
+
   <dd>
     <p>
       <xsl:call-template name="gentext.template">
@@ -151,11 +152,18 @@ GlossEntry ::=
         <xsl:with-param name="name" select="'see'"/>
       </xsl:call-template>
       <xsl:choose>
-        <xsl:when test="@otherterm">
+        <xsl:when test="$target">
           <a href="#{@otherterm}">
             <xsl:apply-templates select="$target" mode="xref"/>
           </a>
         </xsl:when>
+        <xsl:when test="$otherterm != '' and not($target)">
+          <xsl:message>
+            <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
+            <xsl:value-of select="$otherterm"/>
+          </xsl:message>
+          <xsl:apply-templates/>
+        </xsl:when>
         <xsl:otherwise>
           <xsl:apply-templates/>
         </xsl:otherwise>
@@ -186,11 +194,18 @@ GlossEntry ::=
   <xsl:variable name="target" select="$targets[1]"/>
 
   <xsl:choose>
-    <xsl:when test="@otherterm">
+    <xsl:when test="$target">
       <a href="#{@otherterm}">
         <xsl:apply-templates select="$target" mode="xref"/>
       </a>
     </xsl:when>
+    <xsl:when test="$otherterm != '' and not($target)">
+      <xsl:message>
+        <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
+        <xsl:value-of select="$otherterm"/>
+      </xsl:message>
+      <xsl:apply-templates/>
+    </xsl:when>
     <xsl:otherwise>
       <xsl:apply-templates/>
     </xsl:otherwise>