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

Re: Sorting revisited (<xsl:sort>)

Subject: Re: Sorting revisited (<xsl:sort>)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 30 Nov 1999 18:57:45 GMT
sort in xslt
I'll try again:-)

You haven't said what your input document looks like, but I'd guess
that it doesn't match the paths in your select expression.

<xsl:template match="/">
	<!-- snip -->

so this apply templates applies to children of the root node.
There must be exactly one such child, and so xsl:sort has only got
a list of length one to sort.

You probably want to use

<xsl:template match="xxx">

where xxx is your document element.

If you do that then 

the apply templates applies to all the children of the document node.
 <xsl:sort select="*[local-name()=string($sortby)]"

is executed with those children being the current node, this the top
level sortby parameter should name a grandchild of the root, otherwise
the sort key will be null all the time.

If you want to use a sort key that returns a non null value for
the elements named by  $sortby you might want ti use

 <xsl:sort select="self::*[local-name()=string($sortby)]"


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.