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

Subject: RE: [xsl] Confused using a loop...
From: "Austin, Darrel" <Darrel.Austin@xxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Mar 2007 10:42:59 -0500
> the idiom you want is
>
> <xsl:for-each select="/an/x/path"/>
> <xsl:sort selct="relative/path/to/sort/key"/>
> <xsl:if test="position() &lt; 4">
>   do something
> </xsl:if>
> </xsl:for-each>

And that solves my other issue! THANKS! So, this is what I ended up
with:

	<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>

This appears to be working. Thanks everybody!

-Darrel

Current Thread