[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 10:24:46 -0500
RE:  Confused using a loop...
> xsl:for-each select="//menuItem[pageID =
> $pageID]/descendant-or-self::menuItem">
>
> That selects a bunch of menu items which may be descendents of each
> other) These were the menu items that you want to process,
> but you don't process them, just their children (if they have
> menuItem children)

Ack! You are right. That's wrong. I actually want to include all the
children AND the parent item. (so, a menuItem that has a child of pageID
= X and all the child menuItems of that menuItem)

So that takes me back to where I started...seems like this is what I
really need:

xsl:for-each select="//menuItem[ancestor-or-self::/menuItem/pageID =
$pageID]"

Though, that, clearly, is not the proper syntax, as it still doesn't
return the parent node (the menuItem that has a pageID = X)

Why is XSL so hard? ;o)

> for each of those you then select $numberOfItemsToList child menuitems
> 	<xsl:for-each select="menuItem[position() &lt;=
> $numberOfItemsToList]"
> You don't sort these at all.
>
> I don't think you want that inner for-each at all do you?

Well, I'm really not sure. I'm not clear on how sort works. I have a
select that grabs a node, I then sort that node, then don't I need to
select the first 3 from that sorted node if I only want to list 3 items?

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