Commit 8506af41 authored by Dr. Martin Goik's avatar Dr. Martin Goik

Extending embedded image type support

parent 6b4ebf21
......@@ -240,14 +240,30 @@
<xsl:with-param name="svgFilename" select="db:imageobject/db:imagedata/@fileref"/>
</xsl:call-template>
</xsl:variable>
<img src="data:image/svg+xml;base64,{document($base64Filename)/data/text()}"/>
<img>
<xsl:attribute name="src">
<xsl:text>data:image/</xsl:text>
<xsl:variable name="filename" select="db:imageobject/db:imagedata/@fileref"/>
<xsl:choose>
<xsl:when test="substring($filename, (string-length($filename) - 3))= '.svg'">svg+xml</xsl:when>
<xsl:when test="substring($filename, (string-length($filename) - 3))= '.jpg'">jpeg</xsl:when>
<xsl:when test="substring($filename, (string-length($filename) - 3))= '.png'">png</xsl:when>
<xsl:when test="substring($filename, (string-length($filename) - 3))= '.gif'">gif</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Error: File type unknown for image </xsl:text>
<xsl:value-of select="db:imageobject/db:imagedata/@fileref"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
<xsl:text>;base64,</xsl:text>
<xsl:value-of select="document($base64Filename)/data/text()"/>
</xsl:attribute>
</img>
</xsl:template>
<!-- link mode -->
<xsl:template mode="link" match="db:package|db:classname|db:interfacename|db:methodname|db:link|db:uri|db:emphasis|db:code|db:filename|db:foreignphrase|db:productname">
<xsl:choose>
<xsl:when test="@xlink:href">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment