Do you get the error when you save the macro, or when you run it? If when saving, what happens if you put a checkmark in the 'skip testing' box and save the xslt... does the macro run properly?
When you view a page that gives the error, add the ?umbDebugShowTrace=true querystring to the url. That will give you additional output. Scroll down and you'll see some red text. That's the actual error message. That should help you pinpoint the problem.
Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
Extension object 'urn:umbraco.library' does not contain a matching 'NiceURL' method that has 1 parameter(s).
Oddly, 'NiceURL' only has one valid parameter per the v4 API documentation.
(http://umbraco.org/apiDocs/html/Mumbracolibrary_NiceUrl.htm)
I can see from the trace information before the XSLT Error that the Page ID is being passed to the Macro which is a good thing. However, it looks like it is a string value being passed, not an Int32 value.
[code]
umbracoMacro | Macro loaded from cache (ID: 4, Get Page From Library)
renderMacro | Rendering started (macro: Get Page From Library, type: 1, cacheRate: 0)
umbracoMacro | Xslt node adding search start (pageID,'1072')
[/code]
I have tried the 'number($Page)' function to force a numeric value, but that does not seem to help either.
Complete Error Below
[code]
Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
Extension object 'urn:umbraco.library' does not contain a matching 'NiceURL' method that has 1 parameter(s).
at System.Xml.Xsl.Runtime.XmlExtensionFunction.Bind()
at System.Xml.Xsl.Runtime.XmlExtensionFunctionTable.Bind(String name, String namespaceUri, Int32 numArgs, Type objectType, BindingFlags flags)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList1[] args)<br />
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, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in E:\inetpub\wicadev\xslt\GetPageFromLibrary.xslt:line 22
at System.Xml.Xsl.CompiledQuery.Query.
I just found the problem. NiceURL is not the same as NiceUrl. The function is apparently Case SenSiTIve which cause the XSLT error. Thanks for the help!
XSLT NiceURL from Parameter
I am having a problem getting the NiceURL to accept a Content Picker value and turn it into a url. Any thoughts would be greatly appreciated.
MACRO
[code]
[/code]
XSLT
[code]
<>
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">
[/code]
The Content Picker value returns 1072 or [code][/code] which is expected. When put through the NiceURL function, however, it always returns an error.
Error parsing XSLT file: \xslt\GetPageFromLibrary.xslt
Is there anything I am overlooking in this?
Do you get the error when you save the macro, or when you run it? If when saving, what happens if you put a checkmark in the 'skip testing' box and save the xslt... does the macro run properly?
Let us know.
Cheers,
doug.
I do not get an error when saving, only when it tries to render the content.
Ah, okay, that's helpful.
When you view a page that gives the error, add the ?umbDebugShowTrace=true querystring to the url. That will give you additional output. Scroll down and you'll see some red text. That's the actual error message. That should help you pinpoint the problem.
cheers,
doug.
Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
Extension object 'urn:umbraco.library' does not contain a matching 'NiceURL' method that has 1 parameter(s).
Oddly, 'NiceURL' only has one valid parameter per the v4 API documentation.
(http://umbraco.org/apiDocs/html/Mumbracolibrary_NiceUrl.htm)
I can see from the trace information before the XSLT Error that the Page ID is being passed to the Macro which is a good thing. However, it looks like it is a string value being passed, not an Int32 value.
[code]
umbracoMacro | Macro loaded from cache (ID: 4, Get Page From Library)
renderMacro | Rendering started (macro: Get Page From Library, type: 1, cacheRate: 0)
umbracoMacro | Xslt node adding search start (pageID,'1072')
[/code]
I have tried the 'number($Page)' function to force a numeric value, but that does not seem to help either.
Complete Error Below
[code]
Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
Extension object 'urn:umbraco.library' does not contain a matching 'NiceURL' method that has 1 parameter(s).
at System.Xml.Xsl.Runtime.XmlExtensionFunction.Bind()
at System.Xml.Xsl.Runtime.XmlExtensionFunctionTable.Bind(String name, String namespaceUri, Int32 numArgs, Type objectType, BindingFlags flags)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList
1[] args)<br /> 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 E:\inetpub\wicadev\xslt\GetPageFromLibrary.xslt:line 22at System.Xml.Xsl.CompiledQuery.Query.
I just found the problem. NiceURL is not the same as NiceUrl. The function is apparently Case SenSiTIve which cause the XSLT error. Thanks for the help!
is working on a reply...