</xsl:choose>
</xsl:variable>
- <xsl:variable name="output_filename">
- <xsl:choose>
- <xsl:when test="@entityref">
- <xsl:value-of select="$filename"/>
- </xsl:when>
- <!--
- Moved test for $keep.relative.image.uris to template below:
- <xsl:template match="@fileref">
- -->
- <xsl:otherwise>
- <xsl:value-of select="$filename"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
<xsl:variable name="img.src.path.pi">
<xsl:call-template name="pi.dbhtml_img.src.path">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</xsl:variable>
+ <!-- is the file path relative and can be modified by img.src.path? -->
+ <xsl:variable name="is.relative">
+ <xsl:choose>
+ <xsl:when test="$img.src.path != '' and
+ $tag = 'img' and
+ not(starts-with($filename, '/')) and
+ not(starts-with($filename, 'file:/')) and
+ not(contains($filename, '://'))">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:variable name="filename.for.graphicsize">
<xsl:choose>
<xsl:when test="$img.src.path.pi != ''">
<xsl:value-of select="concat($img.src.path.pi, $filename)"/>
</xsl:when>
- <xsl:when test="$img.src.path != '' and
- $graphicsize.use.img.src.path != 0 and
- $tag = 'img' and
- not(starts-with($filename, '/')) and
- not(contains($filename, '://'))">
+ <xsl:when test="$is.relative = 1 and
+ $graphicsize.use.img.src.path != 0">
<xsl:value-of select="concat($img.src.path, $filename)"/>
</xsl:when>
<xsl:otherwise>
<object type="image/svg+xml">
<xsl:attribute name="data">
<xsl:choose>
- <xsl:when test="$img.src.path != '' and
- $tag = 'img' and
- not(starts-with($output_filename, '/')) and
- not(contains($output_filename, '://'))">
+ <xsl:when test="$is.relative = 1">
<xsl:value-of select="$img.src.path"/>
</xsl:when>
</xsl:choose>
- <xsl:value-of select="$output_filename"/>
+ <xsl:value-of select="$filename"/>
</xsl:attribute>
<xsl:call-template name="process.image.attributes">
<!--xsl:with-param name="alt" select="$alt"/ there's no alt here-->
<embed type="image/svg+xml">
<xsl:attribute name="src">
<xsl:choose>
- <xsl:when test="$img.src.path != '' and
- $tag = 'img' and
- not(starts-with($output_filename, '/')) and
- not(contains($output_filename, '://'))">
+ <xsl:when test="$is.relative = 1">
<xsl:value-of select="$img.src.path"/>
</xsl:when>
</xsl:choose>
- <xsl:value-of select="$output_filename"/>
+ <xsl:value-of select="$filename"/>
</xsl:attribute>
<xsl:call-template name="process.image.attributes">
<!--xsl:with-param name="alt" select="$alt"/ there's no alt here -->
<xsl:otherwise>
<xsl:variable name="src">
<xsl:choose>
- <xsl:when test="$img.src.path != '' and
- $tag = 'img' and
- not(starts-with($output_filename, '/')) and
- not(contains($output_filename, '://'))">
+ <xsl:when test="$is.relative = 1">
<xsl:value-of select="$img.src.path"/>
</xsl:when>
</xsl:choose>
- <xsl:value-of select="$output_filename"/>
+ <xsl:value-of select="$filename"/>
</xsl:variable>
<xsl:variable name="imgcontents">
<xsl:element name="{$tag}">