]> granicus.if.org Git - docbook-dsssl/commitdiff
Only output a longdesc link if there's actually a longdesc
authorNorman Walsh <ndw@nwalsh.com>
Thu, 15 Nov 2001 13:01:09 +0000 (13:01 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 15 Nov 2001 13:01:09 +0000 (13:01 +0000)
xsl/html/graphics.xsl

index 059042424203a81e38148e7f87ced02b5f2b5060..dc95c33a3aa55f14c1ebaaf68a767ee877b4b43f 100644 (file)
         </xsl:with-param>
       </xsl:call-template>
 
-      <xsl:if test="$html.longdesc &gt; 0
-                    and $html.longdesc.link &gt; 0">
+      <xsl:if test="$html.longdesc != 0 and $html.longdesc.link != 0
+                    and ancestor::imageobject/parent::*/textobject[not(phrase)]">
         <xsl:call-template name="longdesc.link">
           <xsl:with-param name="longdesc.uri" select="$longdesc.uri"/>
         </xsl:call-template>
 
 <xsl:template name="write.longdesc">
   <xsl:param name="mediaobject" select="."/>
-  <xsl:if test="$html.longdesc">
-    <xsl:if test="$mediaobject/textobject[not(phrase)]">
-      <xsl:variable name="filename">
-        <xsl:call-template name="longdesc.uri">
-          <xsl:with-param name="mediaobject" select="$mediaobject"/>
-        </xsl:call-template>
-      </xsl:variable>
-
-      <xsl:value-of select="$filename"/>
-
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="$filename"/>
-        <xsl:with-param name="content">
-          <html>
-            <head>
-              <title>Long Description</title>
-            </head>
-            <body>
-              <xsl:call-template name="body.attributes"/>
-              <xsl:for-each select="$mediaobject/textobject[not(phrase)]">
-                <xsl:apply-templates select="./*"/>
-              </xsl:for-each>
-            </body>
-          </html>
-        </xsl:with-param>
+  <xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
+    <xsl:variable name="filename">
+      <xsl:call-template name="longdesc.uri">
+        <xsl:with-param name="mediaobject" select="$mediaobject"/>
       </xsl:call-template>
-    </xsl:if>
+    </xsl:variable>
+
+    <xsl:value-of select="$filename"/>
+
+    <xsl:call-template name="write.chunk">
+      <xsl:with-param name="filename" select="$filename"/>
+      <xsl:with-param name="content">
+        <html>
+          <head>
+            <title>Long Description</title>
+          </head>
+          <body>
+            <xsl:call-template name="body.attributes"/>
+            <xsl:for-each select="$mediaobject/textobject[not(phrase)]">
+              <xsl:apply-templates select="./*"/>
+            </xsl:for-each>
+          </body>
+        </html>
+      </xsl:with-param>
+    </xsl:call-template>
   </xsl:if>
 </xsl:template>