Copied to clipboard

Flag this post as spam?

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


  • Allan Hawkey 232 posts 303 karma points
    Oct 13, 2011 @ 21:20
    Allan Hawkey
    0

    Prefix ucomponents.nodes is not defined

    I've just installed v2.2 of uComponents in a website with umbraco 4.7, and added the following to an xslt file to obtain the uniqueID of a member:

    <xsl:value-of select="ucomponents.nodes:GetUniqueId(1740)"/>

    where 1740 is the ID of the member whose Unique ID I need to return in this simple example.

    I got this error on saving the xslt file:

    System.Xml.Xsl.XslLoadException: Prefix 'ucomponents.nodes' is not defined. An error occurred at C:\inetpub\wwwroot\Test\xslt\634541337501939547_temp.xslt(35,2).
    at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

    Can anyone let me know what I'm doing wrong?  (Probably something obvious!)

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 13, 2011 @ 21:32
    Jan Skovgaard
    1

    Hi Allan

    You probably need to add the following prefixe attributes to your xsl:stylesheet element

    xmlns:ucomponents.cms="urn:ucomponents.cms"
    xmlns:ucomponents.dates
    ="urn:ucomponents.dates"
    xmlns:ucomponents.io="urn:ucomponents.io"
    xmlns:ucomponents.media="urn:ucomponents.media"
    xmlns:ucomponents.members="urn:ucomponents.members"
    xmlns:ucomponents.nodes="urn:ucomponents.nodes"
    xmlns:ucomponents.search="urn:ucomponents.search"
    xmlns:ucomponents.strings="urn:ucomponents.strings"
    xmlns:ucomponents.urls="urn:ucomponents.urls"
    xmlns:ucomponents.xml="urn:ucomponents.xml"

    And then you also need to make sure the xmlns prefixes are excluded in the rendered code by adding the prefixes to this attribute: exclude-result-prefixes

    Like this: exclude-result-prefixes="ucomponents.cms ucomponents.dates etc."

    So your xsl:stylesheet element could for instance look like this

    <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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:dropbox="urn:dropbox" xmlns:filesystem="urn:filesystem" xmlns:facebook="urn:facebook" xmlns:flickr="urn:flickr" xmlns:youtube="urn:youtube" xmlns:ucomponents.cms="urn:ucomponents.cms" xmlns:ucomponents.dates="urn:ucomponents.dates" xmlns:ucomponents.io="urn:ucomponents.io" xmlns:ucomponents.media="urn:ucomponents.media" xmlns:ucomponents.members="urn:ucomponents.members" xmlns:ucomponents.nodes="urn:ucomponents.nodes" xmlns:ucomponents.search="urn:ucomponents.search" xmlns:ucomponents.strings="urn:ucomponents.strings" xmlns:ucomponents.urls="urn:ucomponents.urls" xmlns:ucomponents.xml="urn:ucomponents.xml"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets dropbox filesystem facebook flickr youtube ucomponents.cms ucomponents.dates ucomponents.io ucomponents.media ucomponents.members ucomponents.nodes ucomponents.search ucomponents.strings ucomponents.urls ucomponents.xml ">

    In newer versions of Umbraco this is usually done automatically when one creates a new xslt file, but I must admit that I can't remember if it's added automatically to those that have already been created...I think you encounter this problem because you're using ucomponents on a file that has already been created before you installed ucomponents? :-)

    The most easy way to make sure all the above cumbersome and boring stuff is included in your file is to create a new one and then just copy your xsl:template element into the new one or vice verca.

    Hope it makes sense :)

    /Jan

  • Allan Hawkey 232 posts 303 karma points
    Oct 13, 2011 @ 21:49
    Allan Hawkey
    0

    Excellent - that solves the error.  Thank you.

    Now the next problem is that nothing is returned!  The nodeID (1740) is definitely valid, yet the uniqueID is not being displayed.

    Any ideas?

     

     

  • Allan Hawkey 232 posts 303 karma points
    Oct 13, 2011 @ 22:21
    Allan Hawkey
    0

    A bit more info - this seems to work for content nodes, but is not picking up the uniqueID for a member node.  Why would that be?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 13, 2011 @ 22:33
    Jan Skovgaard
    0

    Hi Allan

    I have not been using this particular extension myself but I suppose it's because it's only intended for use on content nodes?

    What is it that you want to achieve? Perhaps there is another way to do it :)

    /Jan

  • Allan Hawkey 232 posts 303 karma points
    Oct 13, 2011 @ 22:56
    Allan Hawkey
    0

    Hi Jan

    Thanks for that - I need a unique, non-guessable, automatically generated ID for each member which I can use to synchronise with data in an external database, and which I can pass as a variable into iframes after a member has logged in to the website so that the member is auto-logged-in to a third party system.

    Would appreciate your ideas...

    Thanks
    Allan

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 14, 2011 @ 09:55
    Lee Kelleher
    0

    Hi Allan,

    That 'GetUniqueId' method only works with content items.  Currently we don't have a matching one in the Members extensions... I'll look to add one for the next release of uComponents. (We don't have a set release date yet - but should be soon).

    Cheers, Lee.

  • Allan Hawkey 232 posts 303 karma points
    Oct 14, 2011 @ 10:00
    Allan Hawkey
    0

    Hi Lee

    That's helpful - thanks.  Could you give me an idea of the sort of timescale you might be looking at for the next release - we have quite an urgent project, so will need to find an alternative workaround unless something's likely to be available in the next week or two...

    Many thanks
    Allan

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 14, 2011 @ 10:07
    Lee Kelleher
    0

    Hi Allan,

    Drop me an email... (via my contact form) should be able to get you a pre-release beta package/zip.

    Cheers, Lee.

  • Allan Hawkey 232 posts 303 karma points
    Oct 14, 2011 @ 10:08
    Allan Hawkey
    0

    Think there's a broken link to the contact form??

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Oct 14, 2011 @ 10:09
    Lee Kelleher
    1

    Fixed it - didn't prefix "http://" :-$

Please Sign in or register to post replies

Write your reply to:

Draft