Copied to clipboard

Flag this post as spam?

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


  • Kenny 11 posts 32 karma points
    May 13, 2010 @ 22:37
    Kenny
    0

    Error parsing XSLT file: When no image is selected in Media Picker

    I have an .xslt which places an image fine...however, when no image is selected I get the above error: "Error parsing XSLT file:"

    My code is now as below...can anyone help me with an if statement preventing the error when no image is selected in the media picker?

     

    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">


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

    <xsl:param name="currentPage"/>


    <xsl:variable name="imgSource" select="umbraco.library:GetMedia($currentPage/data[@alias='ProductLink1'], 'false')/data [@alias = 'umbracoFile']" />


    <xsl:template match="/">


    <img src="{$imgSource}" />


    </xsl:template>

    </xsl:stylesheet>

     

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    May 13, 2010 @ 22:41
    Sebastiaan Janssen
    0

    Please refer to Lee Kelleher's blog post on how to use GetMedia properly.

  • Kenny 11 posts 32 karma points
    May 13, 2010 @ 22:52
    Kenny
    0

    Thank you so much...problem solved!!!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies