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

Subject: Re: [xsl] Confused using a loop...
From: Abel Braaksma <>
Date: Wed, 28 Mar 2007 17:59:15 +0200
Austin, Darrel wrote:

<xsl:for-each select="//menuItem[ancestor-or-self::menuItem/pageID =
$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:if test="position() &lt; $numberOfItemsToList">
<xsl:call-template name="createItem" />

Btw, from a previous thread you seemed to be using the much easier translate() version, suggested by Michael Kay: , i.e.:

<!-- this -->
<xsl:sort select="translate(lastUpdate,'/','')" date-type="number" />

<!-- or this: -->
<xsl:sort select="translate(lastUpdate,'/ ','')" date-type="number" />

something like that.

Why did you change to the more verbose version you have above? Isn't having one xsl:sort statement instead of three easier?

-- Abel

Current Thread