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

Re: generic sorting problem

Subject: Re: generic sorting problem
From: "peter willard donisthorpe" <paytur@xxxxxxxxxxx>
Date: Tue, 06 Sep 2005 20:10:03 +0000
generic sorting
I need to sort the children of the root element by _their_ first child.

I suggest you try this for a starters:


<xsl:template match="/*">
	<xsl:copy>
		<xsl:copy-of select="@*"/>
		<xsl:for-each select="*">
			<xsl:sort select="*[1]"/>
			<xsl:copy-of select="."/>
		</xsl:for-each>
	</xsl:copy>
</xsl:template>


Excellent, Thanks so much.


And I simply change the "1" to sort on another sub element I see ! I understimated the flexibility of this xsl.

Do you care to give a blow by blow account of the above ?

Should I be looking at xpath or something before playing with xsl ? I must be going about it the wrong way. Oh well, more fun :)

Thanks again.

Peter

_________________________________________________________________
MSN Messenger 7.5 is now out. Download it for FREE here. http://messenger.msn.co.uk


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.