[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Confused using a loop...

Subject: RE: Confused using a loop...
From: "Austin, Darrel" <Darrel.Austin@xxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Mar 2007 09:58:10 -0500
RE:  Confused using a loop...
> 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 =
$pageID]/descendant-or-self::menuItem">
	<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;=
$numberOfItemsToList]">
		<xsl:call-template name="createItem" />
	</xsl:for-each>
</xsl:for-each>
===================

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

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

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

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

-Darrel

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.