Copied to clipboard

Flag this post as spam?

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


  • neil 5 posts 20 karma points
    Feb 03, 2009 @ 17:52
    neil
    0

    XSLT Error: System.OverflowException: Value was either too large or too small for an Int32.

    I have only started today so sorry if this is a stupid question, but in a macro this works:

    [code]


    [/code]
    but this does not - i get the OverflowException.

    [code]


    [/code]
    Where am I going wrong?

    Many Thanks,

    Neil

    ooops - wrong forum category for a start. Sorry....

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Feb 03, 2009 @ 17:58
    Dirk De Grave
    0

    Hi neil,

    Is that at design-time? If so, then yes, this error should occur cause it is being verified against a top node which might not have that property. A solution is to surround the xsl:value-of with a xsl:if statement.

    Hope this helps.

    Regards,
    /Dirk

  • neil 5 posts 20 karma points
    Feb 03, 2009 @ 18:12
    neil
    0

    That makes sense.

    Thanks for you help!

  • cdennis 3 posts 22 karma points
    Aug 01, 2010 @ 07:15
    cdennis
    0

    Hi,

    I am having a similar issue (Int32) in Umbraco 4.5 using new XML format and would appreciate any tips:

    I see the correct value of $thumb which is the NodeID from the data picker so I assume I have the right variable, and if I put a NodeID in place of $thumb it returns the image.

    Any thoughts?

    Thanks,

    Chris

     

        <xsl:for-each select="$currentPage/* [@isDoc]">
          
            <xsl:variable name="thumb" select="stillthumb"/>
          
            <xsl:value-of select="$thumb"/>        

    <xsl:variable name="thumbnail" select="umbraco.library:GetMedia($thumb, 0)" /> 
             
        <img src="{$thumbnail/Image/umbracoFile}" alt="@nodeName" style="height: 158px; width: 280px;" /></a>
                     
        </xsl:for-each>

  • Sascha Wolter 615 posts 1101 karma points
    Aug 01, 2010 @ 14:38
    Sascha Wolter
    0

    Have you tried converting the value in $thumb explicitly to a number, like

    <xsl:variable name="thumb" select="number(stillthumb)" />?

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 01, 2010 @ 14:51
    Sebastiaan Janssen
    1

    The problem is in the way you call GetMedia. Once $thumb does not contain an int (or it can't yet determined if it will ever contain an int), you get this error.

    I would do something like this (and yes, converting to a number is a great idea!):

    <xsl:if test="number($thumb) &gt; 0">
      <xsl:variable name="thumbnail" select="umbraco.library:GetMedia(number($thumb), 0)" /> 
    </xsl:if>  
    
    
  • cdennis 3 posts 22 karma points
    Aug 01, 2010 @ 15:43
    cdennis
    0

    Hi,


    Thank you both for your suggestions - I had already tried them previously to no effect. However I've implemented the casting and the if-test again; and now I'm seeing a different error:

    With a value-of in the if condition, I'm seeing the nodeID's.

    Thanks again,

    Chris

    Error in XSLT at line 38, char 64

    38: >>>   <img src="{$thumbnail/Image/umbracoFile}" alt="@nodeName" style="height: 158px; width: 280px;" /> <<<

           <xsl:variable name="thumb" select="number(stillthumb)" />
            
            <xsl:if test="$thumb > 0">
              <xsl:variable name="thumbnail" select="umbraco.library:GetMedia($thumb, 0)" />  
            xsl:if>
           
            <href="{umbraco.library:NiceUrl(@id)}" class="thumb"><img src="{$thumbnail/Image/umbracoFile}" alt="@nodeName" style="height: 158px; width: 280px;" />a>

  • 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