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

Re: grouping within for-each statements

Subject: Re: grouping within for-each statements
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 23 Nov 2001 19:01:15 +0000
for each statements
Hi Todd,

> i don't get the right output (it doesn't treat entry/@id = 1 as
> exclusive from entry/@id=2, it seems taht the following:: statement
> is being too restrictive, how can i get the following:: statement to
> only looking at information in the node(s) specified by the for-each
> statement?

You probably need to use the following-sibling:: axis (which looks at
the siblings of the node you're looking at - the week elements that
have the same parent entry in other words) instead of the following::
axis (which looks at *all* the following nodes in the document, no
matter where they occur [aside from descendants, of course]).

So try:

  week[not(@opp = following-sibling::week/@opp)]

or:

  week/@opp[not(. = ../following-sibling::week/@opp)]

Alternatively, you could use a key and the Muenchian grouping method
to create your groups. That will probably be more efficient,
especially if you have lots of week elements. Have a look at
http://www.jenitennison.com/xslt/grouping/muenchian.html for a
description.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.