Copied to clipboard

Flag this post as spam?

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


  • Tizer 170 posts 201 karma points
    Dec 02, 2011 @ 09:09
    Tizer
    0

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

    I'm getting this error when saving this problem xslt file (I couldn't get it to format - so linked to it)

    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)

    It wasn't happening previously to this, and the only thing I have done is add an li to another xslt file.

    I did a debug using umbraco?umbDebugShowTrace=true - and nothing showed up in red, and when I looked through - data was showing for the xslt file...

    Any help would be most appreciated :)

  • Tizer 170 posts 201 karma points
    Dec 02, 2011 @ 12:43
    Tizer
    0

    OK - I'm still stuck with this, but I 'think' it related to the variables I am using here

    <xsl:variable name="FooterRightTitle"><xsl:value-of select="umbraco.library:GetPreValueAsString($currentPage/ancestor-or-self::node[@nodeName='Home']/data[@alias='FooterRightTitle'])"/></xsl:variable> 


    <xsl:variable name="FooterRightClass">
    <xsl:choose>
    <xsl:when test="$FooterRightTitle='Latest News'">latestNews</xsl:when>
    <xsl:otherwise>Fcompetitions</xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    <xsl:variable name="FooterRightH3Tag">
    <xsl:choose>
    <xsl:when test="$FooterRightTitle='Latest News'">The Latest News</xsl:when>
    <xsl:otherwise>Competition</xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    And the solution lies with doing a test like this

    <xsl:if test="$rootFolderId != ''">
    code goes here
    </xsl:if>

    But I have no clue where to put the 'if tests'.... do I wrap the whole code block in 3 if tests? If so in what order?

    Sorry - xslt newbide/dummy

     

  • Tizer 170 posts 201 karma points
    Dec 02, 2011 @ 13:57
    Tizer
    0

    Ok - fixed - nothing to do with the xslt (blush) - it was a media picker Datatype which was selecting an unpublished node.

    But - I thought I had this covered with this code:

    <xsl:if test="$currentPage/ancestor-or-self::node/data[@alias = 'quicklink3'] != ''">
    <xsl:variable name="quicklink3" select="$currentPage/ancestor-or-self::node/data[@alias = 'quicklink3']" />
    <li>
    <a href="{umbraco.library:NiceUrl($currentPage/ancestor-or-self::node/descendant-or-self::node[@id = $quicklink3]/@id)}">
    <xsl:value-of select="$currentPage/ancestor-or-self::node/descendant-or-self::node[@id = $quicklink3]/data[@alias = 'pageTitle']" />
    </a>
    </li>
    </xsl:if>

    I want these to test to see if there is a value - if there is, then output the <li>, if not, then so nothing... should I be using xsl:when and xsl:otherwise here?

     

  • 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