]> granicus.if.org Git - docbook-dsssl/commitdiff
Pass $img.src.path to Java image extensions when appropriate
authorJirka Kosek <jirka@kosek.cz>
Wed, 2 Mar 2005 12:02:24 +0000 (12:02 +0000)
committerJirka Kosek <jirka@kosek.cz>
Wed, 2 Mar 2005 12:02:24 +0000 (12:02 +0000)
xsl/html/graphics.xsl

index ab09ed17f3d6fcda81ce5dcb55ae69e7fe18c757..a97f69bc283ac0b0272be962e2df725dd99ceb5e 100644 (file)
     </xsl:choose>
   </xsl:variable>
 
+  <xsl:variable name="filename.with.img.src.path">
+    <xsl:choose>
+      <xsl:when test="$img.src.path != '' and
+                      $tag = 'img' and
+                      not(starts-with($filename, '/')) and
+                      not(contains($filename, '://'))">
+        <xsl:value-of select="concat($img.src.path, $filename)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$filename"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:variable name="intrinsicwidth">
     <!-- This funny compound test works around a bug in XSLTC -->
     <xsl:choose>
       <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0">
         <xsl:choose>
           <xsl:when test="function-available('simg:getWidth')">
-            <xsl:value-of select="simg:getWidth(simg:new($filename),
+            <xsl:value-of select="simg:getWidth(simg:new($filename.with.img.src.path),
                                                 $nominal.image.width)"/>
           </xsl:when>
           <xsl:when test="function-available('ximg:getWidth')">
-            <xsl:value-of select="ximg:getWidth(ximg:new($filename),
+            <xsl:value-of select="ximg:getWidth(ximg:new($filename.with.img.src.path),
                                                 $nominal.image.width)"/>
           </xsl:when>
           <xsl:otherwise>
       <xsl:when test="$use.extensions != 0 and $graphicsize.extension != 0">
         <xsl:choose>
           <xsl:when test="function-available('simg:getDepth')">
-            <xsl:value-of select="simg:getDepth(simg:new($filename),
+            <xsl:value-of select="simg:getDepth(simg:new($filename.with.img.src.path),
                                                 $nominal.image.depth)"/>
           </xsl:when>
           <xsl:when test="function-available('ximg:getDepth')">
-            <xsl:value-of select="ximg:getDepth(ximg:new($filename),
+            <xsl:value-of select="ximg:getDepth(ximg:new($filename.with.img.src.path),
                                                 $nominal.image.depth)"/>
           </xsl:when>
           <xsl:otherwise>