Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2006, 09:52 AM
Registered User
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sort by a value that's a comma seperated list

Ok here's my problem.

I am using xsl to style a result set. Some values are text, some are numbers and one is a comma seperated list. Some values might have numerous list items "8,6,4,2" others may be just one list item "2". The list is always the highest values first. What I want to do is sort (numeric) this list by the first (or only) value in the list.

The item that contains the list is called "validSplit"

If I use: <xsl:sort select="substring-before(validSplit,',')" order="descending" data-type="number"/>
It works providing the list has more than 1 item. However when the list has only 1 item, there is obviously no comma, therefore the value is blank.

If anyone could steer me in the right direction, please let me know.
Thanks.

Mike





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is a comma allowed in a List Box? williamlove Access 5 June 6th, 2008 06:28 AM
comma separated list MunishBhatia SQL Server 2000 11 March 21st, 2007 03:56 PM
selecting elements from comma separated list rjonk XSLT 4 September 29th, 2006 08:46 AM
comma separated list of attributes rjonk XSLT 3 September 27th, 2006 11:52 AM
need comma seperated values in select atulmar SQL Server 2000 2 April 12th, 2005 07:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.