If I only have the first NiceURL it works fine, when I have the code as above (ie including the second NiceURL I get the following error when trying to save the xslt:
[quote](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) in d:\inetpub\wwwroot\ccnet\Source\Umbraco 3.1\umbraco\presentation\umbraco\webservices\codeEditorSave.asmx.cs:line 124
[/code]
You probably receive this error because $currentPage/data[@alias='AltURL1'] can be empty.
In this case the NiceUrl function cannot be called because it requires an integer parameter.
Try testing for $currentPage/data[@alias='AltURL1'] != ''
Error with NiceUrl
Can anyone see whats wrong the with attached.
[code] [/code]
If I only have the first NiceURL it works fine, when I have the code as above (ie including the second NiceURL I get the following error when trying to save the xslt:
[quote](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) in d:\inetpub\wwwroot\ccnet\Source\Umbraco 3.1\umbraco\presentation\umbraco\webservices\codeEditorSave.asmx.cs:line 124
[/code]
Doesn't NiceUrl expect an ID of a node?
What does your AltURL1 and AltURL2 properties contain?
Yes, NiceUrl expects an integer which should be the ID of the node.
AltURL1 and AltURL2 are both Content Picker fields
Have you made sure that the pages they are pointing to are published?
You probably receive this error because $currentPage/data[@alias='AltURL1'] can be empty.
In this case the NiceUrl function cannot be called because it requires an integer parameter.
Try testing for $currentPage/data[@alias='AltURL1'] != ''
is working on a reply...