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

using xsl:for-each-group, grouping by child nodes?

Subject: using xsl:for-each-group, grouping by child nodes?
From: Eric Scheid <eric.scheid@xxxxxxxxxxxxxxx>
Date: Sat, 04 Oct 2008 17:38:36 +1000
 using xsl:for-each-group
I have export data that looks like this:

<RESULTSET FOUND="6">
    <ROW MODID="3" RECORDID="1">
        <COL><DATA>joe</DATA></COL>
        <COL><DATA>2</DATA></COL>
        <COL><DATA>pitcher</DATA></COL>
        <COL><DATA>ny</DATA></COL>
        <COL><DATA>mets</DATA></COL>
    </ROW>
    <ROW MODID="3" RECORDID="2">
        <COL><DATA>mark</DATA></COL>
        <COL><DATA>11</DATA></COL>
        <COL><DATA>outfielder</DATA></COL>
        <COL><DATA>ny</DATA></COL>
        <COL><DATA>mets</DATA></COL>
    </ROW>
    <ROW MODID="3" RECORDID="3">
        <COL><DATA>jane</DATA></COL>
        <COL><DATA>13</DATA></COL>
        <COL><DATA>outfielder</DATA></COL>
        <COL><DATA>ny</DATA></COL>
        <COL><DATA>cubs</DATA></COL>
    </ROW>
    <ROW MODID="3" RECORDID="4">
        <COL><DATA>mike</DATA></COL>
        <COL><DATA>7</DATA></COL>
        <COL><DATA>outfielder</DATA></COL>
        <COL><DATA>ny</DATA></COL>
        <COL><DATA>mets</DATA></COL>
    </ROW>
</RESULTSET>

I'm trying to transform it into this:

    Team: mets, ny
        pitchers:
            joe, 2
        oufielders:
            mark, 11
            mike, 7

    Team: cubs, ny
        outfielders:
            jane, 13

.. so naturally I thought of using for-each-group, only problem is I can't
find any examples which shows how to group-by using values in the child
nodes .. so I don't know if this is even possible, let alone exactly how to
specify it. I've tried a few different things to no avail.

Is this even possible?

e.


-- 
Ironclad Networks
Information Architecture
http://www.ironclad.com.au/

"Providing tactical IA services to web agencies"

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.