Copied to clipboard

Flag this post as spam?

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


  • Chris Larson 48 posts 63 karma points
    May 18, 2009 @ 17:23
    Chris Larson
    0

    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?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 18, 2009 @ 17:35
    Douglas Robar
    0

    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.

  • Chris Larson 48 posts 63 karma points
    May 18, 2009 @ 19:44
    Chris Larson
    0

    I do not get an error when saving, only when it tries to render the content.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 18, 2009 @ 21:06
    Douglas Robar
    0

    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.

  • Chris Larson 48 posts 63 karma points
    May 18, 2009 @ 23:53
    Chris Larson
    0

    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.

  • Chris Larson 48 posts 63 karma points
    May 19, 2009 @ 00:22
    Chris Larson
    0

    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!

Please Sign in or register to post replies

Write your reply to:

Draft