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

Grouping within sub elements

Subject: Grouping within sub elements
From: "Steve W" <lsl@xxxxxxxxxxxxx>
Date: Sat, 29 Jan 2005 07:45:50 -0000
sub elements
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

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.