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

Re: axis and sorting, or a two run task?

Subject: Re: axis and sorting, or a two run task?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 10 Nov 1999 15:56:03 GMT
axis foreach task
> Given the following xml,

That isn't well formed xml so I am not sure I understood the question
and havent tested the following answer.

However

>  I want to
> output  the topic only once,
> then output the sorted q and a elements.

sounds like
<xsl:for-each select="qna/topic[not(. = following::topic)]"/>
 <xsl:sort select="."/>
 <xsl:value-of select="."/>
<!-- so this gives you all topics once in sorted sorted order
Now you want to get all the qna s that have a topic with the same value as
this, sorted in q order
 -->
  <xsl:for-each /wrapper/qna[topic = current()]>
   <xsl:sort select="q">
    whatever you want here
 </xsl:for-each>
 </xsl:for-each>

Any question that involves getting unique sorting should trigger a
standard pointer to saxon's group constructs which probably avoid
the overhead in building that following::topic list each time.


David


 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.