Error parsing XSLT file: \xslt\Navi.xslt

Sep 11, 2010 at 10:13 PM

Hi

I get this error when I try to view any page within CWS. I have only just installed it. It is a clean install (no other packages have been installed, and Umbraco – the latest version – was installed yesterday… and it's a new server). The details are:

Value was either too large or too small for an Int32.
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 System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\virtualservers\umbraco.urltba.com\xslt\Navi.xslt:line 36
  at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
  at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
  at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
  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.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
  at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
  at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt)
  at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements)

I'd e very grateful if you could help!

Robin

Sep 13, 2010 at 8:18 AM

Hello Robin.

Please can you try the following for me first:

  • Login to Umbraco and republish all the nodes in the site
  • Does that make any difference?

If that does not work can you tell me about your umbraco installation:

  • What version of Umbraco
  • What Database are you using
  • Is the site installed in the root of a site or a subdirectory?
  • What version of IIS
  • What OS is the server running
  • Any other details that you think maybe useful to help find out what the problem is

Thanks,
Warren :)

Sep 14, 2010 at 2:54 PM

Hi Warren, i have the same problem that Robin, and i tried with republish all the nodes in the site, but it didn't work. This is the information about my umbraco installation:

  • Umbraco_4.5.2_NET3.5
  • Sql Server 2005 Express
  • Installed in root directory
  • IIS 7
  • Windows 7 Enterprise
  • the site is empty, without examples (no runaway and other beginner packages).

Thanks for the help.

Jorge

 

Sep 14, 2010 at 3:39 PM

Hi Warren

Sorry for the delay in responding. I tried republishing all the nodes, but that made no difference.

The installation is Umbraco 4.5.2 (Assembly version: 1.0.3891.20719); database is in MS SQL Server 2008 Express; site is installed in root of website; IIS 7.5; Windows Web Server 2008 R2

Can't think of anything else that might be pertinent.

Robin

Sep 16, 2010 at 10:48 AM

Hello Jorge & Robin,
OK this is very odd, can you confirm the following for me please.

If you open the XSLT/Navi.xslt and copy and paste the contents for me here, so I can verify something.

Thanks,
Warren :)

 

Sep 16, 2010 at 4:44 PM

Hi Warren this is the content of the XSLT/Navi.xslt, by my self i verified when i just only save the xslt from the Developer section give a similar error when i use debbug option :

<?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"
  exclude-result-prefixes="msxml umbraco.library">


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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

        <ul id="navi">

            <xsl:variable name="rootNode" select="$currentPage/ancestor::root/node" />
            
            <li>
                <!--
                    Add the class selected if the root node ID matches our
                    current node ID in the for each loop
                    -->
                <xsl:if test="$rootNode/@id = $currentPage/@id">
                    <xsl:attribute name="class">
                        <xsl:text>
                            selected
                        </xsl:text>
                    </xsl:attribute>
                </xsl:if>
                
                <a href="{umbraco.library:NiceUrl($rootNode/@id)}">
                    <xsl:value-of select="$rootNode/@nodeName" />
                </a>
            </li>
            
            <xsl:for-each select="$currentPage/ancestor-or-self::node/node [@level = 2 and string(data[@alias='umbracoNaviHide']) != '1']">
                <li>
                    <!--
                    Add the class selected if the currentpage or parent nodes (up the tree to the root)
                    ID matches our current node ID in the for each loop
                    -->
                    <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
                        <xsl:attribute name="class">
                            <xsl:text>
                                selected
                            </xsl:text>
                        </xsl:attribute>
                    </xsl:if>
                    
                    <a href="{umbraco.library:NiceUrl(@id)}">
                        <xsl:value-of select="@nodeName" />
                    </a>
                </li>
            </xsl:for-each>
        </ul>

    </xsl:template>

</xsl:stylesheet>

 

THIS IS THE WRONG MESSAGE WHEN I ONLY SAVE THE CONTENT OF THE XSLT:

Error occured

System.OverflowException: Value was either too large or too small for an Int32.
en System.Convert.ToInt32(Double value)
en System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
en System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
en System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
en System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
en (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
en Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
en Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
en System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
en System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
en System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
en System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
en System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
en umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging).

Thanks for the help.

Jorge

Sep 17, 2010 at 10:16 AM

Hello Jorge & Robin,
As I had suspected it seems that an older version of the CWS package has been installed into your umbraco installation.
The XSLT reffers to the OLD XML Schema before Umbraco 4.5.

Can I confirm you downloaded this via the Package Repository?

This is what I recommend for now, as it seems that the package repository is not delivering the correct version of CWS to you.
Delete your Umbraco installation and start again from scratch (delete the DB and re-create it and similar with website files)

Then download the latest version of Umbraco CWS from the our.umbraco.org project page - version 2.0.3
http://our.umbraco.org/projects/starter-kits/creative-website-starter-%28cws%29

Sorry for any inconvenience caused I will try and speak to the Umbraco guys to find out why it is delivering the wrong version of CWS via the package repository.

Thanks,
Warren :)

Sep 17, 2010 at 3:48 PM

Hi Warren, i downloaded the version 2.0.3 and it works fine. Sure that Robin will do the same and it will work.

Thanks a lot.

Jorge

Sep 17, 2010 at 5:12 PM

Hi Warren

Thanks for getting to the bottom of this so quickly. I haven't had a chance to download the new version yet, as I'm in the middle of another project but, from what Jorge says, I'm sure it will work.

Thanks again

Robin

Sep 18, 2010 at 12:54 PM

Hi Warren,

I am using Umbraco 4.5.x and I ran into the same issue.

I solved the problem by uninstalling the CWS 2.0.2, logging out, recycling the app pool and then installing the CWS 2.0.3.

I wanted to keep my local installation instead of installing a new one. Everything seems to work perfectly.