Re: [xsl] Confused using a loop...

Subject: Re: [xsl] Confused using a loop...
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 28 Mar 2007 17:25:26 +0200
Austin, Darrel wrote:
The problem is that my result isn't sorted.

I'm a bit confused as to how SORT works. My first select should be
selecting all menuItems that are or ar a child of one with a specific
pageID.

Then, I assume the sort commands sorts that group of selected menuItems

To learn how xsl:sort works, I suggest you use xsl:value-of right after the statement that should be doing the sorting:


<xsl:sort select="some/Xpath">
<sort-by>
   <xsl:value-of select="some/Xpath">
</sort-by>

The select of xsl:sort is relative to the context item. If <sort-by> in the output does not contain anything, your xpath is wrong and that is why sort 'does not work'.

On 'how sort works': it takes the string-normalized value of the nodes you select in xsl:sort and uses that to sort by.

Cheers,
-- Abel

Current Thread