Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 13:36
    TaoistTotty
    0

    XSLT image not displaying in IE

    I am using the following XSLT to display a single image from the Media section.

     

    In all browsers (FireFox, Opera and Safari) it is displaying the image, but not in IE.

     

    Any know why, and what I can do to fix this?

     

    <xsl:choose> <xsl:when test="string(./data [@alias='latestNewsImage']) != '' "> <div> <div class="lnleft"> <p><strong><xsl:value-of select="data [@alias = 'headline']" disable-output-escaping="yes"/></strong></p> <a style="float:left" href="{umbraco.library:NiceUrl(@id)}"><img alt="left Arrow" height="8px" width="4px" src="../../aawen/main/images/leftarrow.jpg" /> read more ...</a> </div> <div class="lnright"> <img style="float:right"> <xsl:attribute name="src"> <xsl:value-of select="umbraco.library:GetMedia(./data [@alias='latestNewsImage'], 'false')/data [@alias='umbracoFile']" /> </xsl:attribute> </img> </div> </div> </xsl:when> <xsl:otherwise>

     

    Thanking in advance.

     

  • dandrayne 1138 posts 2262 karma points
    Jan 12, 2010 @ 14:12
    dandrayne
    0

    Hi There

    I don't see anything obviously wrong with your xsl (although you may want to use absolute paths for images).  What is the resulting html code?

    Cheers,
    Dan

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 12, 2010 @ 14:26
    Lee Kelleher
    0

    Hi,

    What is your <xsl:output /> method set to? If it's HTML, then the <img> tag might cause problems in IE, e.g.

    <img src="..."></img>

    Try changing the method to XML:

    <xsl:output method="xml" />

    So that it outputs as:

    <img src="..." />

    Good luck, Lee.

  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 15:34
    TaoistTotty
    0

    Lee thank you for your reply the xml output is:

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    Dan thank you for your help and the resulting HTML is:

    <div class="lnright"><img style="float:right" src="/media/6583/optimaicon4col.jpg" /></div>

     

    I hope this helps, and I am glad to hear that the XSLT looks alright (so far). 

     

     

  • dandrayne 1138 posts 2262 karma points
    Jan 12, 2010 @ 18:28
    dandrayne
    0

    Strange:  The image is being written out and just not appearing?  In IE a broken image gives a box witht he red cross, so this might well be a problem with css.  If you disable your stylesheet temporarily can you see the image in IE?

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jan 12, 2010 @ 18:32
    Peter Dijksterhuis
    0

    Can it be a caching issue in IE? Try disabling caching (if you haven't allready)

  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 19:57
    TaoistTotty
    0

    Peter, thank you for your suggestion, but I have tried this without any joy.

    Dan, disabling the stylesheet does not make a difference. One thing I have notices is that the URL given for the image is not the same as the actual (assuming it was a physical folder). The folder 6583 is called optima. I do not know if this is the difference.

    Another thing is that this is within some jquery to make the area scroll (without scroll bar etc.). I will try removing this and see what happens.

    Thanks again for your help.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jan 12, 2010 @ 20:47
    Peter Dijksterhuis
    0

    And just now you tell us you use jquery ;-)

    Try opening the full URL to the image in IE. The image should show just fine. If it does, it's probably something in jquery messing up in IE.

    If the image doesn't show in IE, there's something else wrong. Try checking the media-folder to see if the image is actually there.

    HTH,

    Peter

  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 21:27
    TaoistTotty
    0

    Peter thank you for getting back to me. It is not the jquery (disabled this).

    I used the URL to the image in the browser and it works (e.g. shows the image) in Opera, Safari (on PC and Mac) and FireFox, but not in IE.

    The image is a jpg, so I do not know why this would appear in all browsers apart from 1.

    I will now try changing the image and see if this helps.

    Thanks once again for your help.

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jan 12, 2010 @ 21:31
    Peter Dijksterhuis
    0

    ah, perhaphs it is the jpg itself then. I've had this behaviour with a client of mine as well. They saved the image on a Mac, somehow IE couldn't handle that. Could you try saving the jpg with some different settings?

  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 21:39
    TaoistTotty
    0

    Peter many thanks.

    It was something to do with the image/folder.

    I have replaced this and all is now working.

    Now the question is why did this just affect IE?

    Thanks everyone for your help.

  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 21:40
    TaoistTotty
    0

    This was the same, with the client machine being a Mac.

    Is this wide spread?

    I am asking because they are going to be uploading a number of files, and they are a Mac only business.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jan 12, 2010 @ 21:41
    Peter Dijksterhuis
    0

    One last question then: was the original image (the one that didn't work) created on a Mac? Not sure what causes it, but if you save it with some default setting on a Mac, IE can't display it somehow. Don't ask me why, perhaphs someone else knows the answer to that.

  • TaoistTotty 246 posts 314 karma points
    Jan 12, 2010 @ 21:51
    TaoistTotty
    0

    Peter, yes the image was created and saved on a Mac (using Photoshop CS4).

    All I did was to re-save the file and it worked (on a Windows machine (using GIMP)).

Please Sign in or register to post replies

Write your reply to:

Draft