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

RE: Sorting resulttree to multiple levels

Subject: RE: Sorting resulttree to multiple levels
From: Jarno.Elovirta@xxxxxxxxx
Date: Thu, 15 May 2003 13:25:20 +0300
RE:  Sorting resulttree to multiple levels
Hi,

> What I need is to sort the resulttree. This seems to be 
> somekind of grouping
> problem. The structure of xml is supposed to describe a 
> discussion tree.
> Should I try some key solution or what?
> 
> So the result is supposed to be something like:
> 
> id41 (from element <knowledge-object id="41"> )
>   47 (<unstructured-source>47</unstructured-source>
>   48
>    49
>     50
>    51
>   52
> 
> id42
>   23
>    24
>     25
>    26
>   27

Well, you could define a key

  <xsl:key name="id" match="knowledge-object" use="@id" />

and then just recursively go through knowledge-object and always retrieving their sub-topics. In your stylesheet you tried to use xsl:for-each, but you really need xsl:apply-templates to make the processing recursive. The only problem you have is how to identify the topic root knowledge-object to start the processing, but since the example data is incomplete, it's hard to tell what will indicated root topics.

Cheers,

Jarno - Assemblage 23: Anthem

 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.