Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello!
I seem to be completely missing something and I am hoping one of you can help..
I have created an xslt extension which I have used before and I am referencing in a few of my xslt files and alls working well.
I have now added a new function to my code that I want to call from xslt and it's not happening properly.
My function is called "GetTeamName", it accepts an Id and returns a string
My extension is referenced at the top of my xslt like so: (I know i has a random name.. ignore that)
xmlns:Domains="urn:Domains"
I have this in my xslt that is calling the id (which it gets from a custom dropdown datatype)
<xsl:value-of select="data [@alias = 'Team']"/>
To get the team name I am using the following:
<xsl:variable name="teamId" select="data [@alias = 'Team']"/>
<strong>Domains:GetTeamName(@teamId)</strong>
But all I get on the page is Domains:GetTeamName(@teamId) in bold!
What am I doing wrong? I can't work out what I'm missing as I have used the domains extension before I've just added a new function!
Bex
another duplicate.. please ignore and use the other one
Hi Bex!
I can't seem to find "the other post", so I guess that this is the right one to answer.
To use your extension, you need to write it out in a value-of. Like this:
<xsl:value-of select="Domains:GetTeamName($teamId)" />
This will print out whatever is returned from the extension.
/Kim A
Ohh, and by the way, when you are referring the variable, teamId, you have to use the $-sign and not the @-sign :)
Thanks for your reply Kim! Yes I did solve it.. think I was having a Friday Afternoon blip! :)
I should have out a link here but that said I can't find it my self now as this is the one that appears in my notifications..
Ahh, I have just found the other post by looking at your profile. Didn't think of that yesterday :)
To anyone interested it can be found here: http://our.umbraco.org/forum/developers/xslt/13613-XSLT-Extensions-What%27s-wrong-with-this
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
XSLT Extensions - What's wrong with this?
Hello!
I seem to be completely missing something and I am hoping one of you can help..
I have created an xslt extension which I have used before and I am referencing in a few of my xslt files and alls working well.
I have now added a new function to my code that I want to call from xslt and it's not happening properly.
My function is called "GetTeamName", it accepts an Id and returns a string
My extension is referenced at the top of my xslt like so: (I know i has a random name.. ignore that)
I have this in my xslt that is calling the id (which it gets from a custom dropdown datatype)
To get the team name I am using the following:
But all I get on the page is Domains:GetTeamName(@teamId) in bold!
What am I doing wrong? I can't work out what I'm missing as I have used the domains extension before I've just added a new function!
Bex
another duplicate.. please ignore and use the other one
Hi Bex!
I can't seem to find "the other post", so I guess that this is the right one to answer.
To use your extension, you need to write it out in a value-of. Like this:
<xsl:value-of select="Domains:GetTeamName($teamId)" />
This will print out whatever is returned from the extension.
/Kim A
Ohh, and by the way, when you are referring the variable, teamId, you have to use the $-sign and not the @-sign :)
/Kim A
Thanks for your reply Kim! Yes I did solve it.. think I was having a Friday Afternoon blip! :)
I should have out a link here but that said I can't find it my self now as this is the one that appears in my notifications..
Ahh, I have just found the other post by looking at your profile. Didn't think of that yesterday :)
To anyone interested it can be found here: http://our.umbraco.org/forum/developers/xslt/13613-XSLT-Extensions-What%27s-wrong-with-this
is working on a reply...