Hi Anthony, you cannot reassign variables or parameters, but within the loop you can initialize a variable to the specified select, e.g. something like this:
So, i'm not sure if i can achieve this with xslt. I need to get @alias ='region' of the previous item in the foreach. I see the preceeding axis is not supported yet.
I think all the axis types are supported, they are just not in the book you linked to.
I don't know your current script, but maybe it could be possible to take the <xsl:if ... /> part out of it, and incorporate that part into your for-each xpath instead?
I didn't realise you could incorporate the if with the for each. Do you have any examples of <span style="white-space: pre-wrap;"> <xsl:call-template></span>
reassign values to params
Is it possible to reassign values to params? I'm trying to use param as global variable in c# talk.
<xsl:param name="SelectedRegion" select="" />
<xsl:for-each select="$currentPage/../node [@nodeTypeAlias = 'Assets']/child::node">
Hi Anthony, you cannot reassign variables or parameters, but within the loop you can initialize a variable to the specified select, e.g. something like this:
>Tommy
ah ok, thanks for clearing that up.
So, i'm not sure if i can achieve this with xslt. I need to get @alias ='region' of the previous item in the foreach. I see the preceeding axis is not supported yet.
http://umbraco.org/documentation/books/xslt-basics/xpath-axes-and-their-shortcuts
Also i have an 'if statement' just after my foreach so i don't alway want the preceeding items. Hmm, usercontrol?
I think all the axis types are supported, they are just not in the book you linked to.
I don't know your current script, but maybe it could be possible to take the <xsl:if ... /> part out of it, and incorporate that part into your for-each xpath instead?
Another approach would be do the loop recursively using the <xsl:call-template> tag.
cool, thank morten.
I didn't realise you could incorporate the if with the for each. Do you have any examples of <span style="white-space: pre-wrap;"> <xsl:call-template></span>
Thanks, Anthony
Anthony,
The sitemap xslt (which is available from the dropdown when creating an xslt) does have an example on how to use templates recursively.
(File on disk can be found at /umbraco/xslt/templates/Sitemap.xslt
Cheers,
/Dirk
is working on a reply...