xsl-list
[Top] [All Lists]

Grouping within sub elements

2005-01-29 00:45:50
I have been trying to use the Muenchian method to group sub-elements within
a particular element.  So I have something like :

<BODY>
    <ITEM>
        <ID>AA</ID>
        <SUBITEM>1</SUBITEM>
        <SUBITEM>2</SUBITEM>
        <SUBITEM>1</SUBITEM>
        <SUBITEM>3</SUBITEM>
        <SUBITEM>2</SUBITEM>
    </ITEM>
    <ITEM>
        <ID>BB</ID>
        <SUBITEM>1</SUBITEM>
        <SUBITEM>4</SUBITEM>
        <SUBITEM>1</SUBITEM>
        <SUBITEM>4</SUBITEM>
        <SUBITEM>4</SUBITEM>
    </ITEM>
    <ITEM>
        <ID>CC</ID>
        <SUBITEM>2</SUBITEM>
        <SUBITEM>2</SUBITEM>
        <SUBITEM>3</SUBITEM>
        <SUBITEM>3</SUBITEM>
        <SUBITEM>2</SUBITEM>
    </ITEM>
</BODY>

If I was to group all the subitems, I'd use something like <xsl:key
name="subs" match="BODY/ITEM" use="SUBITEM" />.

Can I apply the same sort of logic within an item group,  to get some output
something like :

Item AA
Subitems 1, 2, 3
Item BB
Subitems 1,4
Item CC
Subitems 2, 3

I can't help thinking I'm missing something obvious but can't see it !

Thanks for all help.

Steve


--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>