umbracoTags functions not recognized in XSLT files Options
saelfaer
Posted: Wednesday, May 14, 2008 11:51:30 AM
Rank: Newbie

Joined: 5/14/2008
Posts: 23
Location: Brugge Belgium
hi,

I am experimenting with the umbracoTagging package created by Per Ploug Hansen
more info on his blog (http://objects.dk/2007/11/2/umbraco-tagging-package.aspx)

though installation was successful, following his screencasts i could create the datatype without any trouble, adding tags to certain documentTypes also went like a breeze...

now, when creating a macro / xslt to list all Categories (tags) with their count()
i keep getting an error (see QUOTE block below)
i also added the code i use (see CODE block below)

i am relatively new to umbraco, i mean to the development side then...
i used umbraco alot for templates and content.... before but this is 1 of the first times i come in contact with the dev side. So my knowledge of xslt is not that high. i added the reference in top of the xslt file yet still he can't find the umbracoTags object / functions...
anyone an idea how this can be solved?




error wrote:

Error occured
System.Xml.Xsl.XsltException: 'umbracoTags.library.getAllTagsInGroup()' is an unknown XSLT function.
at System.Xml.Xsl.XsltOld.XsltCompileContext.ResolveFunction(String prefix, String name, XPathResultType[] argTypes)
at MS.Internal.Xml.XPath.FunctionQuery.SetXsltContext(XsltContext context)
at System.Xml.Xsl.XsltOld.Processor.GetCompiledQuery(Int32 key)
at System.Xml.Xsl.XsltOld.Processor.StartQuery(XPathNodeIterator context, Int32 key)
at System.Xml.Xsl.XsltOld.ForEachAction.Execute(Processor processor, ActionFrame frame)
at System.Xml.Xsl.XsltOld.ActionFrame.Execute(Processor processor)
at System.Xml.Xsl.XsltOld.Processor.Execute()
at System.Xml.Xsl.XslTransform.Transform(XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver)
at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String fileContents, Boolean ignoreDebugging)



the code i use currently is: (basicly ALL the same as the screencast...)
Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<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:umbracoTags.library="urn:umbracoTags.library"
exclude-result-prefixes="msxml umbraco.library umbracoTags.library">


<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>

<xsl:template match="/">
<ul>
<xsl:for-each select="umbracoTags.library.getAllTagsInGroup('sandbox')/tags/tag">
<li>
<a href="/?filterby={current()}">
<xsl:value-of select="current()"/></a> (<xsl:value-of select="@nodesTagged"/>)
</li>
</xsl:for-each>
</ul>
</xsl:template>

</xsl:stylesheet>




Sander Houttekier, Umbraco Level 2 Certified
Dirk
Posted: Wednesday, May 14, 2008 12:39:00 PM

Rank: Fanatic

Joined: 9/27/2007
Posts: 403
Location: Belgium
Based on some posts I've seen in this forum, try

umbracoTags.library:getAllTagsInGroup()

instead of

umbracoTags.library.getAllTagsInGroup()

(last dot replaced by semicolon)


level 1 certified - umbraco blog at netaddicts.be
saelfaer
Posted: Wednesday, May 14, 2008 2:26:26 PM
Rank: Newbie

Joined: 5/14/2008
Posts: 23
Location: Brugge Belgium
oh dirk, my hero :)
no, serious, thank you for the aid

i will check if i can find me some quick xslt crashcourses to get familiar with the syntax

thanks again for the help

Sander Houttekier, Umbraco Level 2 Certified
drobar
Posted: Wednesday, May 14, 2008 2:36:13 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,408
Location: KY, USA
Check out Casey's great umbraco book at http://www.umbraco.org/documentation/books/xslt-basics. It will help a lot to get you started.

Also, when you create a new xslt in umbraco, you can select from a number of pre-built templates. They will not only save time, but will show you the common ways to do many of the things that you will do with macros again and again.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.