Copied to clipboard

Flag this post as spam?

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


  • Tri 7 posts 27 karma points
    Mar 19, 2010 @ 08:41
    Tri
    0

    error in GetMedia()

    when i add

    <xsl:variable name="TeaserImage" select="umbraco.library:GetMedia(data [@alias = 'teaserImage'],'false')/data [@alias='umbracoFile']"/> 
    in my xslt code  it gives following error

    (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

     any solution for this please help

     

     

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Mar 19, 2010 @ 10:10
    Jan Skovgaard
    0

    In which context do you add it? Is it inside a for-each loop?

    If not I'm guessing that you need to write $currentPage/data [@alias = 'teaserImage']...so your variable becomes

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

    Hth

    /Jan

  • Tri 7 posts 27 karma points
    Mar 19, 2010 @ 10:41
    Tri
    0

    it is inside for-each loop as follows

    <div id="ContentDiv">
    <xsl:for-each select="$currentPage/node/node">

    <xsl:if test="data [@alias = 'teaserImage'] != ''">

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

    <div class="ContentHomeDiv">
     <h3> 
      <a href="#">
      <span style="background:url({$TeaserImage}) no-repeat 0px 8px">
      <xsl:value-of select="data [@alias = 'teaserTitle']" disable-output-escaping="yes"/>
      </span>
      </a> 
     </h3>

     <xsl:value-of select="data [@alias = 'teaserContent']" disable-output-escaping="yes"/>
     <a href="#"><xsl:value-of select="data [@alias = 'teaserLinkText']" disable-output-escaping="yes"/>
     </a>
    </div>
    </xsl:if>
     

    </xsl:for-each>
    </div>

  • 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