Copied to clipboard

Flag this post as spam?

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


  • alexei 21 posts 40 karma points
    Dec 09, 2009 @ 19:08
    alexei
    0

    GetMedia Problem

    Hi, all

    I try to use macro to choose folder for GetMedia:

    <xsl:variable name="GalFolder" select="/macro/GalFolder"/>
    ...
    <xsl:for-each select="umbraco.library:GetMedia($GalFolder, 'true')/child::node [@nodeTypeAlias = 'Image']">

    but I can't save xslt because of an error:

     

    Error occured

    System.OverflowException: Value was either too large or too small for an Int32. 
    at System.Convert.ToInt32(Double value) 
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider) 
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) 
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType) 
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) 
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) 
    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.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter 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)

     

    What can I try to do?

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Dec 09, 2009 @ 19:54
    Peter Dijksterhuis
    3

    Try this:

    <xsl:if test="$GalFolder != '' ">
    <xsl:for-each select="umbraco.library:GetMedia($GalFolder, 'true')/child::node [@nodeTypeAlias = 'Image']">
    </xsl:if>

    HTH,

    Peter

  • alexei 21 posts 40 karma points
    Dec 09, 2009 @ 21:44
    alexei
    0

    Peter, thanks it works.

  • Kelsee Ishmael 71 posts 158 karma points
    May 26, 2011 @ 19:28
    Kelsee Ishmael
    0

    Thanks Peter! You've also helped me out!

  • 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