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
Hi,
I have some XSLT which works out all the node ID's I need to display, for example my code returns 3459,3567,3486
I then split these and loop through them to show details of the 3 nodes.
3459 - A Product
3567 - Z Product
3486 - S Product
However I would like to display these alphabetically?
Using the XSLT sort function won't work as I'm grabbing each record individually, would appreciate any ideas.
Many thanks
Rich
Hi Rich,
There's a good old trick that'll put those into the same node set:
<xsl:variable name="$nodeIDs" select="1200,1203,3489,2309" /> <xsl:variable name="root" select="$currentPage/ancestor-or-self::root" /> <xsl:template match="/"> <xsl:for-each select="$root//node[contains(concat(',', $nodeIDs, ','), concat(',', @id, ','))]"> <xsl:sort select="@nodeName" /> ... </xsl:for-each> </xsl:template>
/Chriztian
Chriztian,
Thanks so much! Perfect!
:)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Sorting nodes alphabetically from a comma separated node list
Hi,
I have some XSLT which works out all the node ID's I need to display, for example my code returns 3459,3567,3486
I then split these and loop through them to show details of the 3 nodes.
3459 - A Product
3567 - Z Product
3486 - S Product
However I would like to display these alphabetically?
Using the XSLT sort function won't work as I'm grabbing each record individually, would appreciate any ideas.
Many thanks
Rich
Hi Rich,
There's a good old trick that'll put those into the same node set:
/Chriztian
Chriztian,
Thanks so much! Perfect!
:)
Rich
is working on a reply...