Copied to clipboard

Flag this post as spam?

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


  • Paul 55 posts 76 karma points
    Jul 26, 2012 @ 09:51
    Paul
    0

    XSLT for images giving an error in 4.7.2

    I have added images to my mdeia section that I am attempting to access via xslt. It works in the development environment which is version 4.7.1.1 but fails in version 4.7.2. I have the following error:

    If is failing at the assignment of the variable mediaItem. See code snippet:

            <xsl:variable name="mediaItem" select="umbraco.library:GetMedia(pioneerImage, 0)" /> 

              <xsl:if test="$mediaItem">

                <img>

                  <xsl:attribute name="src">

                    <xsl:value-of select="$mediaItem/umbracoFile" />

                  </xsl:attribute>

                  <xsl:attribute name="width">

                    <xsl:value-of select="27" />

                  </xsl:attribute>

                  <xsl:attribute name="height">

                      <xsl:value-of select="35" />

                  </xsl:attribute>

                   <xsl:attribute name="alt">

                      <xsl:value-of select="@nodeName"/>

                  </xsl:attribute>

                </img>

              </xsl:if>

    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) 

    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) 

    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)

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jul 26, 2012 @ 09:59
    Alex Skrypnyk
    1

    Hi Paul,

    Please, try change your checking of data.

    <xsl:if test="$mediaitem != ''>

     

  • Paul 55 posts 76 karma points
    Jul 26, 2012 @ 11:13
    Paul
    0

    I was able to solve the problem using Courier. Some how it worked when I transfered the files from my development box to the server. No changes were made to the code. Thanks anyway.

Please Sign in or register to post replies

Write your reply to:

Draft