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

Simple grouping with XSL2

Subject: Simple grouping with XSL2
From: Andy Kohn <andydev@xxxxxxxxx>
Date: Fri, 31 Jul 2009 13:14:07 +1000
 Simple grouping with XSL2
I'm trying to do a simple grouping and then post the siblings but I'm
a little bit confused.

I have the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<Entries>
   <entry>
      <First>First Group</First>
      <Second>sample data I</Second>
   </entry>
   <entry>
       <First>Second Group</First>
      <Second>sample data II</Second>
   </entry>
    <entry>
        <First>First Group</First>
        <Second>sample data III</Second>
    </entry>
</Entries>

I'm trying to group the data using the <First> tag and then show all
the <Second> tags data.
Example of the result:

<Entries>
   <entryTransformation>
      <data>First Group</data>
      <secondaryData>sample data I</secondaryData>
      <secondaryData>sample data III</secondaryData>
   </entryTransformation>
   <entryTransformation>
      <data>Second Group</data>
      <secondaryData>sample data II</secondaryData>
   </entryTransformation>
</Entries>


I'm using
<xsl:for-each-group select="/Entries/entryTransformation/data" group-by=".">
To make the grouping, but then I don't know how to iterate the
<Second> elements.

Thanks,

Andy.

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-2007 All Rights Reserved.