]> granicus.if.org Git - docbook-dsssl/commitdiff
Add support for param img.src.path to image items in opf manifest.
authorBob Stayton <bobs@sagehill.net>
Fri, 8 Mar 2013 18:14:57 +0000 (18:14 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 8 Mar 2013 18:14:57 +0000 (18:14 +0000)
xsl/epub3/epub3-element-mods.xsl

index 171fb2c97329ae92f6328a379c7b3b61188fe908..8ba786dc034b3e53e0a26a025892adc428a48d8e 100644 (file)
@@ -1237,12 +1237,20 @@ article  toc,title,figure,table,example,equation
   
     <xsl:variable name="object" select="$olist[position() = $object.index]"/>
 
-    <xsl:variable name="image.filename">
+    <xsl:variable name="output_filename">
       <xsl:call-template name="mediaobject.filename">
         <xsl:with-param name="object" select="$object"/>
       </xsl:call-template>
     </xsl:variable>
 
+    <xsl:variable name="image.filename">
+       <xsl:if test="$img.src.path != '' and
+                       not(starts-with($output_filename, '/')) and
+                       not(contains($output_filename, '://'))">
+         <xsl:value-of select="$img.src.path"/>
+       </xsl:if>
+       <xsl:value-of select="$output_filename"/>
+    </xsl:variable>
     <xsl:variable name="image.extension">
       <xsl:call-template name="filename-extension">
         <xsl:with-param name="filename" select="$image.filename"/>
@@ -1602,12 +1610,21 @@ article  toc,title,figure,table,example,equation
   <xsl:param name="object" select="."/>
 
   <xsl:if test="$object">
-    <xsl:variable name="image.filename">
+    <xsl:variable name="output_filename">
       <xsl:call-template name="mediaobject.filename">
         <xsl:with-param name="object" select="$object"/>
       </xsl:call-template>
     </xsl:variable>
 
+    <xsl:variable name="image.filename">
+       <xsl:if test="$img.src.path != '' and
+                       not(starts-with($output_filename, '/')) and
+                       not(contains($output_filename, '://'))">
+         <xsl:value-of select="$img.src.path"/>
+       </xsl:if>
+       <xsl:value-of select="$output_filename"/>
+    </xsl:variable>
+
     <xsl:variable name="image.extension">
       <xsl:call-template name="filename-extension">
         <xsl:with-param name="filename" select="$image.filename"/>