[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sort on more than one element
Raj, >iam using xsl:sort and i need to sort of more than one element > >ex > ><xsl:sort select="col1;col2"/> > >the parser says that it does not expect a ';'. I tried a ',' - but dint work too. > >what is the right way to do this. The right way is to use two xsl:sort elements to specify the two levels of the sort: <xsl:sort select="col1" /> <xsl:sort select="col2" /> The advantage of this syntax over a comma-separated list is that you can have different properties attached to the two sorts, such as the order in which the list is sorted by these cols, or whether the cols are treated as text or numbers: <xsl:sort select="col1" order="ascending" data-type="text" /> <xsl:sort select="col2" order="descending" data-type="number" /> You can add as many xsl:sorts as you want within an xsl:for-each or an xsl:apply-templates. I hope that this helps, Jeni Jeni Tennison http://www.jenitennison.com/ 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
|