In "pure" XSLT there isn't a string.Join equivalent. As Rich says, if you're dealing with strings, then concat is the way to go.
We do have an XSLT extension in uComponent 2.1 (beta) called "Concat" - this can take a nodeset and then join it together using a separator string/character.
thaks rich, thats just what i needed :) The extension you are talking about lee does sound like it will suit me more. ill give this a try as well. thanks both.
String Join in umbraco xslt
is there any way of joining strings together in umbraco xslt? I tried this which i found in a google search but umbraco didnt seem to like it.
<xsl:variable name="newItem" select="string-join( ('a', 'b', 'c'), '')" />
im trying to do the following:
<xsl:variable name="test" select="1,2,3" />
i want to be able to add another number to the end so its like
<xsl:variable name="test" select="1,2,3,4" />
how can i do this?
Hey Phil,
You can use concat
<xsl:value-of select="concat('a', 'b', 'c')"/>
More details http://www.xsltfunctions.com/xsl/fn_concat.html
Rich
Hi Phil,
In "pure" XSLT there isn't a string.Join equivalent. As Rich says, if you're dealing with strings, then concat is the way to go.
We do have an XSLT extension in uComponent 2.1 (beta) called "Concat" - this can take a nodeset and then join it together using a separator string/character.
e.g.
Cheers, Lee.
thaks rich, thats just what i needed :) The extension you are talking about lee does sound like it will suit me more. ill give this a try as well. thanks both.
is working on a reply...