Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#14 XSLT for Media Object in IE5.5

closed-wont-fix
XSL (122)
5
2006-04-27
2001-07-09
No

This is the MediaObject XSLT that I created for IE 5.5
it only supports PNG and images so far.

<xsl:template match="mediaobject">
<xsl:choose>
<xsl:when test="imageobject and
imageobject/imagedata/@format = 'PNG' and not
(textobject)">
<span>
<xsl:attribute
name="style">width:1px;height:1px;filter:progid:DXImage
Transform.Microsoft.AlphaImageLoader(src='<xsl:value-
of
select="imageobject/imagedata/@fileref" />');</xsl:attr
ibute>
<img>
<xsl:attribute name="src"><xsl:value-of
select="imageobject/imagedata/@fileref" /></xsl:attribu
te>
<xsl:attribute name="alt"><xsl:value-of
select="imageobject/imagedata/@fileref" /></xsl:attribu
te>
<xsl:attribute name="style">filter:Alpha
(opacity=0);</xsl:attribute>
</img>
</span>
</xsl:when>
<xsl:when test="imageobject and
imageobject/imagedata/@format = 'PNG' and textobject">
<span>
<xsl:attribute
name="style">width:1px;height:1px;filter:progid:DXImage
Transform.Microsoft.AlphaImageLoader(src='<xsl:value-
of
select="imageobject/imagedata/@fileref" />');</xsl:attr
ibute>
<img>
<xsl:attribute name="src"><xsl:value-of
select="imageobject/imagedata/@fileref" /></xsl:attribu
te>
<xsl:attribute name="alt"><xsl:value-of
select="textobject/phrase" /></xsl:attribute>
<xsl:attribute name="style">filter:Alpha
(opacity=0);</xsl:attribute>
</img>
</span>
</xsl:when>
<xsl:when test="imageobject and not(textobject)">
<img>
<xsl:attribute name="src"><xsl:value-of
select="imageobject/imagedata/@fileref" /></xsl:attribu
te>
<xsl:attribute name="alt"><xsl:value-of
select="imageobject/imagedata/@fileref" /></xsl:attribu
te>
</img>
</xsl:when>
<xsl:when test="imageobject and textobject">
<img>
<xsl:attribute name="src"><xsl:value-of
select="imageobject/imagedata/@fileref" /></xsl:attribu
te>
<xsl:attribute name="alt"><xsl:value-of
select="textobject/phrase" /></xsl:attribute>
</img>
</xsl:when>
</xsl:choose>
</xsl:template>

Discussion

  • Norman Walsh
    Norman Walsh
    2001-12-01

    Logged In: YES
    user_id=81663

    What does this code do?

     
  • Logged In: YES
    user_id=55322

    This code block adds support for rendering PNG files in IE
    5.5. IE 5.5 does not support PNG files with the IMG tag
    properly (i.e., does not support alpha transperency only
    mask based transparency) however they have a PNG filter
    that does support it properly and this code uses it if PNG
    is specified.

     
  • Logged In: YES
    user_id=118135

    The DocBook XSL stylesheets don't attempt to support
    IE 5.5

     
    • labels: 313527 --> XSL
    • assigned_to: nobody --> xmldoc
    • status: open --> closed-wont-fix
     
  • Logged In: YES
    user_id=118135

    The DocBook XSL stylesheets don't attempt to support
    IE 5.5