You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by "fabio.noferi@libero.it" <fa...@libero.it> on 2004/02/26 16:37:51 UTC

problem with object tag

if insert an image with bxe and publish the document there is a problem with explorer 6.0. 
(the problem is in live and auth version) 
in explorer the object tag assume that the height and width settings are set to zero, and we won't see anything (the image), 
In mozilla all go well.

why don't replace the <object> tag with <img> like epoz, to the next building?

ciao fabio



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: problem with object tag

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
fabio.noferi@libero.it wrote:

> if insert an image with bxe and publish the document there is a problem with explorer 6.0. 
> (the problem is in live and auth version) 
> in explorer the object tag assume that the height and width settings are set to zero, and we won't see anything (the image), 
> In mozilla all go well.
> 
> 
> why don't replace the <object> tag with <img> like epoz, to the next building?

object is used to hold additional information (metadata etc) that are 
not available in img. i suggest you transform object to img. i believe 
this is already being done in the default publication, if not, you may 
use something like

  <xsl:template match="xhtml:object" priority="3">
     <div align="left">
       <xsl:choose>
         <xsl:when test="normalize-space(text())">
           <table bgcolor="#F5F5F5" border="0" cellpadding="0" 
cellspacing="0">
             <tr>
               <td align="left">
                 <xsl:call-template name="object_link"/>
               </td>
             </tr>
             <tr>
               <td class="caption">
                 <xsl:apply-templates />
               </td>
             </tr>
           </table>
         </xsl:when>
         <xsl:otherwise>
           <xsl:call-template name="object_link"/>
         </xsl:otherwise>
       </xsl:choose>
     </div>
   </xsl:template>


   <xsl:template name="object_link">
     <xsl:choose>
       <xsl:when test="@href != ''">
         <a href="{@href}">
           <img border="0">
             <xsl:attribute name="src">
               <xsl:value-of select="$nodeid"/>/<xsl:value-of 
select="@data"/>
             </xsl:attribute>
             <xsl:attribute name="alt">
               <!-- the overwritten title (stored in @name) has 
precedence over dc:title -->
               <xsl:choose>
                 <xsl:when test="@name != ''">
                   <xsl:value-of select="@name"/>
                 </xsl:when>
                 <xsl:otherwise>
                   <xsl:value-of select="dc:metadata/dc:title"/> 

                 </xsl:otherwise>
                 </xsl:choose>
             </xsl:attribute>
              <xsl:if test="string(@height)">
               <xsl:attribute name="height">
                 <xsl:value-of select="@height"/>
               </xsl:attribute>
             </xsl:if>
             <xsl:if test="string(@width)">
               <xsl:attribute name="width">
                 <xsl:value-of select="@width"/>
               </xsl:attribute>
             </xsl:if>
           </img>
         </a>
       </xsl:when>
       <xsl:otherwise>
         <img border="0">
           <xsl:attribute name="src">
             <xsl:value-of select="$nodeid"/>/<xsl:value-of select="@data"/>
           </xsl:attribute>
           <xsl:attribute name="alt">
               <!-- the overwritten title (stored in @name) has 
precedence over dc:title -->
               <xsl:choose>
                 <xsl:when test="@name != ''">
                   <xsl:value-of select="@name"/>
                 </xsl:when>
                 <xsl:otherwise>
                   <xsl:value-of select="dc:metadata/dc:title"/> 

                 </xsl:otherwise>
                 </xsl:choose>
           </xsl:attribute>
           <xsl:if test="string(@height)">
               <xsl:attribute name="height">
                 <xsl:value-of select="@height"/>
               </xsl:attribute>
         </xsl:if>
         <xsl:if test="string(@width)">
               <xsl:attribute name="width">
                 <xsl:value-of select="@width"/>
               </xsl:attribute>
         </xsl:if>
         </img>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>


-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org