Re: axis and sorting, or a two run 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
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