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

Subject: RE: [xsl] Confused using a loop...
From: "Austin, Darrel" <Darrel.Austin@xxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Mar 2007 09:58:10 -0500
> not necessarily, it would be easier just to do
> select="(some/x/path)[position() &lt;= $numberOfItemsToList]">
> which will just select the first $numberOfItemsToList items.

Ah. That does look easier.

So, I now have this:

<xsl:for-each select="//menuItem[pageID =
	<xsl:sort select="substring(lastUpdate,1,4)" order="descending"
/> <!-- year  -->
	<xsl:sort select="substring(lastUpdate,6,2)" order="descending"
/> <!-- month -->
	<xsl:sort select="substring(lastUpdate,9,2)" order="descending"
/> <!-- day   -->
	<xsl:for-each select="menuItem[position() &lt;=
		<xsl:call-template name="createItem" />

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

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

Finally, my second select grabs the first 3 menuItems from that sorted

But that isn't working, so I'm not quite understanding  what's going on


Current Thread