I'm building a new site, and have updated the new instance from 4.0 to 4.5. Now my navigation XSLT is throwing errors. My top navigation uses a drop down menu and now isn't working.
The error I receive is:
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, IList`1 parent)
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, 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.presentation.webservices.codeEditorSave.SaveXslt(String
fileName, String oldName, String fileContents, Boolean ignoreDebugging)
I think I've narrowed the problem down to this line:
I've been searching around the forums trying to find any navigation problems with the same XSLT as mine, but haven't had any success. So I'm not sure how I should write this with the new schema, can anyone help with my XSLT? Thanks in advance.
Below is the full XSLT that I'm using for the top navigation.
Here you can see some examples with new schema, and update your xslt, or you can continue using old schema but then be shure to change UseLegacyXmlSchema setting in the config/UmbracoSettings.config file to true.
Another note, When you upgrade ensure that you republish the site as the new schema might not have been updated in the DB. This was a mistake I found recently.
It's pretty easy to upgrade the XSLT to the new version when you get the hang of it and it is much quicker to write. However be aware you may have to rewrite more XSLT documents than you realise.
Just remember when switching between the new and old schema to republish the site.
Upgrade 4.0 to 4.5 has broken my navigation
I'm building a new site, and have updated the new instance from 4.0 to 4.5. Now my navigation XSLT is throwing errors. My top navigation uses a drop down menu and now isn't working.
The error I receive is:
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, IList`1 parent)
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, 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.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
I think I've narrowed the problem down to this line:
I've been searching around the forums trying to find any navigation problems with the same XSLT as mine, but haven't had any success. So I'm not sure how I should write this with the new schema, can anyone help with my XSLT? Thanks in advance.
Below is the full XSLT that I'm using for the top navigation.
Hi,
if you upgraded to v4.5 then you are using new xml schema, and your xslt won't work (there is no more "node" element).
Your code will be something like:
Here you can see some examples with new schema, and update your xslt, or you can continue using old schema but then be shure to change UseLegacyXmlSchema setting in the config/UmbracoSettings.config file to true.
Cheers.
Another note, When you upgrade ensure that you republish the site as the new schema might not have been updated in the DB. This was a mistake I found recently.
It's pretty easy to upgrade the XSLT to the new version when you get the hang of it and it is much quicker to write. However be aware you may have to rewrite more XSLT documents than you realise.
Just remember when switching between the new and old schema to republish the site.
Tim
Thanks for the help Almir and Tim,
That piece of code was needed. Then I ran the XSLT through the convertor created by Tommy Poulson. High five!
Now I've got my Main, Side and Footer menu's all working perfectly!
Cheers!
is working on a reply...