[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sorting text-number strings?
> Is there a way to achieve a sort with results?: > title 1, title2, title 3,..., title 9, title 10, title 11 XSL isn't especially good (actually it's normally hopeless) at infering structure from character data, so it would have had a much easier time if the characters and numbers had been separated in the input <title name="this string" number="42"/> or some such. Actually I don't understand your description of the input "title 1, title2, some other name, title 3, ..., title 9, title 10, title 11" especially as your suggested output is title 1, title2, title 3,..., title 9, title 10, title 11 what happened to `some other name' and why didn't that have a number, so I'll ignore that and just give an example that sorts strings or the form "abc 123" ie characters, space, numbers, first on the first word, then numerically on the digits. <xsl:for-each select="whatever"> <xsl:sort data-type="text" select="substring-before(.,' ')"/> <xsl:sort data-type="number" select="substring-after(.,' ')"/> ... 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
|