[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] svg and <object> tag conflict
The small modification was to utilize a new parameter.
<xsl:param name="use.object.for.svg" select="'1'"/>
Which was used like this:
<xsl:variable name="img"> <xsl:choose> <xsl:when test="@format = 'SVG'">
<!-- Removing object tag for svg files--> <xsl:if test="$use.object.for.svg != 0"> <object data="{$filename}" type="image/svg+xml"> <xsl:call-template name="process.image.attributes"> <!--xsl:with-param name="alt" select="$alt"/ there's no alt here--> <xsl:with-param name="html.depth" select="$html.depth"/> <xsl:with-param name="html.width" select="$html.width"/> <xsl:with-param name="longdesc" select="$longdesc"/> <xsl:with-param name="scale" select="$scale"/> <xsl:with-param name="scalefit" select="$scalefit"/> <xsl:with-param name="scaled.contentdepth" select="$scaled.contentdepth"/> <xsl:with-param name="scaled.contentwidth" select="$scaled.contentwidth"/> <xsl:with-param name="viewport" select="$viewport"/> </xsl:call-template> <xsl:if test="@align"> <xsl:attribute name="align"> <xsl:choose> <xsl:when test="@align = 'center'">middle</xsl:when> <xsl:otherwise> <xsl:value-of select="@align"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:if> </xsl:if>
<xsl:if test="$use.embed.for.svg != 0">
<embed src="{$filename}" type="image/svg+xml"> <xsl:call-template name="process.image.attributes"> <!--xsl:with-param name="alt" select="$alt"/ there's no alt here --> <xsl:with-param name="html.depth" select="$html.depth"/> <xsl:with-param name="html.width" select="$html.width"/> <xsl:with-param name="longdesc" select="$longdesc"/> <xsl:with-param name="scale" select="$scale"/> <xsl:with-param name="scalefit" select="$scalefit"/> <xsl:with-param name="scaled.contentdepth" select="$scaled.contentdepth"/> <xsl:with-param name="scaled.contentwidth" select="$scaled.contentwidth"/> <xsl:with-param name="viewport" select="$viewport"/> </xsl:call-template> </embed> </xsl:if> <!-- Removing object tag for svg files--> <xsl:if test="$use.object.for.svg != 0"> </object> </xsl:if> </xsl:when>
Perhaps this template could be componentized in future releases to make customization more workable.
Thanks, Troy
-----Original Message-----
The template that generates the object element with embed inside (name="process.image" in html/graphics.xsl) is a very large template (over 500 lines). It has an xsl:choose case for SVG (<xsl:when test="@format = 'SVG'">), and it would not be difficult to remove the <object> element that it generates. But it means copying that large template to your customization layer and making a small modification. That should work, but it means you will have to check each stylesheet release to see if that big template has changed at all, and repeat the process.
Bob Stayton
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]