summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2010-04-05 12:00:09 -0500
committerShaun McCance <shaunm@gnome.org>2010-04-05 12:00:09 -0500
commit4acecb1f1873e2966a58395f308eb4c7910fdd24 (patch)
tree588d58461a119a518fe16ef2303e1b1c5426c314 /xslt
parent5d524c9032d131b60e47ffb5dc3eb91941351221 (diff)
downloadgnome-doc-utils-4acecb1f1873e2966a58395f308eb4c7910fdd24.tar.gz
[db2html-media.xsl] For SVG imagedata, embed for XHTML and use object for HTML
Diffstat (limited to 'xslt')
-rw-r--r--xslt/docbook/html/db2html-media.xsl31
1 files changed, 31 insertions, 0 deletions
diff --git a/xslt/docbook/html/db2html-media.xsl b/xslt/docbook/html/db2html-media.xsl
index 9b14b43..18d2371 100644
--- a/xslt/docbook/html/db2html-media.xsl
+++ b/xslt/docbook/html/db2html-media.xsl
@@ -43,6 +43,35 @@ REMARK: calls db2html.imagedata.src, how other attrs are gotten
-->
<xsl:template name="db2html.imagedata">
<xsl:param name="node" select="."/>
+ <xsl:choose>
+ <xsl:when test="$node/@format = 'SVG'">
+ <!--
+ We don't really ever want to embed external SVGs, because there's
+ no guarantee they exist at build time. But Yelp 2.30 launches an
+ external viewer when it encounters an <object> tag, so this is
+ the only option. When this was added, gnome-doc-utils and Yelp 2
+ are in maintenance (and hacks) mode. This works for some Ubuntu
+ docs that need SVG.
+ -->
+ <xsl:choose>
+ <xsl:when test="$db2html.namespace = ''">
+ <object type="image/svg+xml">
+ <xsl:attribute name="data">
+ <xsl:call-template name="db2html.imagedata.src">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:copy-of select="@width"/>
+ <xsl:copy-of select="@height"/>
+ </object>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="svg" select="document($node/@fileref)"/>
+ <xsl:copy-of select="$svg"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
<img>
<xsl:attribute name="src">
<xsl:call-template name="db2html.imagedata.src">
@@ -80,6 +109,8 @@ REMARK: calls db2html.imagedata.src, how other attrs are gotten
-->
<!-- FIXME: longdesc -->
</img>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>