[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Sorting revisited (<xsl:sort>)
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 --> <xsl:apply-templates> 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)]" 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
|