xsl-list
[Top] [All Lists]

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

2008-10-04 03:38:46

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"


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--