Copied to clipboard

Flag this post as spam?

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


  • Daniil 5 posts 25 karma points
    Mar 20, 2012 @ 11:34
    Daniil
    0

    image from another page

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:umbraco.contour="urn:umbraco.contour"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">

    <xsl:output method="xml" omit-xml-declaration="yes" />

    <xsl:param name="currentPage"/>

    <!-- Don't change this but create a 'number' element in your -->
    <!-- macro with the alias of 'numberOfItems' -->
    <xsl:variable name="source" select="macro/source"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul class="agendaitems">
      
    <xsl:for-each select="umbraco.library:GetXmlNodeById(1219)">
     
      
      <li>
        <a href="{umbraco.library:NiceUrl(1219)}">
          
            <xsl:value-of select="title"/>
           
     <xsl:variable name="home" select="umbraco.library:GetXmlNodeById(1219)"/>  
     <xsl:if test="$home/fotos != ''">
        <xsl:variable name="images" select="umbraco.library:GetMedia($home/fotos, 0)" />
        <img src="/ImageGen.ashx?image={$images/umbracoFile}&amp;width=135&amp;height=94" alt="image" />
    </xsl:if>
       
       
       
       
        </a>
        
        
      </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

    </xsl:stylesheet>

    Error occured

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    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 System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    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)

    Why do I get an error
    how to solve it

     

  • Rob Watkins 369 posts 701 karma points
    Mar 21, 2012 @ 12:07
    Rob Watkins
    0

    Can't immediatelt see why this would happe, as it looks like $home/fotos should always contain something - I suggest printing out $home/fotos with an xsl:value-of to make sure it is actually an integer as you are expecting.

Please Sign in or register to post replies

Write your reply to:

Draft