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

Re: Sibling sort order

Subject: Re: Sibling sort order
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 31 Mar 2000 14:48:01 GMT
Re: Sibling sort order
> Does anyone know how to select the previous/next sibling while maintaining
> the sort order

the faq for this list has lots of examples of this.

It is hard to do in xsl without using extensions, but not so easy
and its harder in msxsl which hasnt implemented the sibling axes yet.

Easiest is first just sort the original and save the srted list in a
variable (which is a result tree fragment)

then you can select the nodes in that variable and they are in sorted
order. According to te spec you should have to use an extension function
(xt and saxon at least, provide one called node-set) but in msxsl
you can directly treat the result tree fragment as a node set.

so in other words you can go (but once msxsl becomes conformant you will
have to modify slightly)

<xsl:variable name="x">
 <xsl:apply-templates select="*">
   <xsl:sort select="@f1"/>
 </xsl:apply-templates>
</xsl:variable>


then use 
<xsl:apply-templates select="$x/*"/>
rather than <xsl:apply-templates select="*">

David


David

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.