<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)
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
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
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>
is working on a reply...