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

Re: Joining two trees

Subject: Re: Joining two trees
From: Steve Tinney <stinney@xxxxxxxxxxxxx>
Date: Mon, 13 Mar 2000 09:54:21 -0500
eve raimon
> <Root>
>         <Category value="Arts, Entertainment, &amp; Media">
>             <Subject value="African-American Literature">
>            <Person value="RAIMON">
>                     <Alias>RAIMON</Alias>
>                 <Name>Eve Raimon</Name>
>                 </Person>
>             </Subject>
>         </Category>
>         <Category value="Arts, Entertainment, &amp; Media">
>             <Subject value="African-American Literature">
>                 <Person value="JKUENZ">
>                     <Alias>JKUENZ</Alias>
>                     <Name>Jane Kuenz</Name>
>                 </Person>
>             </Subject>
>         </Category>
> </Root>
> 
> As you can see, the Category and Subject nodes repeat, Is there a
> way I can collapse them into just 1 set of Category and Subject nodes?
> I want to iterate over the data and group people who are from similar
> categories and subjects.

Yes, you can do it in XSLT 1.0, but it sounds as though you need to
spend some time with the faq and the specs first.  You don't say whether
you have only one case of Category/@value and Subject/@value that you
want to group with, or whether either @value can have a variety of
values.  This impacts on the answers we can give here.

In general, to solve this kind of problem you can either use a processor
like Saxon, which provides an extension function called saxon:group, or
do more work with sorting, variables and RTF-to-nodeset conversion.

 Steve


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.