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() < 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() < $numberOfItemsToList"> <xsl:call-template name="createItem" /> </xsl:if> </xsl:for-each> This appears to be working. Thanks everybody! -Darrel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Confused using a loop..., David Carlisle | Thread | Re: [xsl] Confused using a loop..., Abel Braaksma |
Re: [xsl] XSLT parsers in a C/C++ A, M. David Peterson | Date | Re: [xsl] XSLT parsers in a C/C++ A, Andrew Welch |
Month |