[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|