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

grouping

Subject: grouping
From: "Günter Pretterhofer" <guenter.pretterhofer@xxxxxx>
Date: Fri, 18 May 2001 16:54:56 +0200
reisekataloge
Hi all,

can you please tell me if it's possible to group by 2 elements?

A simplified example:

<page>
  <ROWSET>
   <ROW>
     <country>Canada</country> 
     <language>french</language> 
   </ROW>
   <ROW>
     <country>Canada</country> 
     <language>english</language> 
   </ROW>
   <ROW>
     <country>Switzerland</country> 
     <language>german</language> 
   </ROW>
   <ROW>
     <country>Switzerland</country> 
     <language>french</language> 
   </ROW>
  </ROWSET>
</page>

When I try something like
<xsl:for-each select="ROW[country=$country]
[not(language=preceding-sibling::ROW/language)]/language">
the result is english, french and german when specifying Switzerland
as country. 

And when I try 
<xsl:for-each select="ROW
[not(../ROW[country=$country]/language=preceding-sibling::ROW[country=$country]/language)]/language">

the result is german.

My favourite result were german and french when specifying Switzerland.

Should I do a reorder first? 
Something like
<country>
  <language>...</language>
</country>

Or is there a solution so that reordering is not necessary?

Thank you very much,
Günter

______________________________________________________________________________
Ferienklick.de - 225 Reisekataloge auf einen Blick!
Direkt zu Ihrem Traumurlaub: http://ferienklick.de/?PP=2-0-100-105-0


 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.