xsl-list
[Top] [All Lists]

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

2007-03-28 09:01:17
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" />
                </xsl:if>
</xsl:for-each>



Btw, from a previous thread you seemed to be using the much easier translate() version, suggested by Michael Kay: http://www.biglist.com/lists/xsl-list/archives/200703/msg00710.html , 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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>