• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XSLT sorting by mixed text/numbers

 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I need to be able to sort by an attribute which is a string that ends with a number. For example:

"documentType -1"
"documentType -2"
"anotherDocumentType -1"
"anotherDocumentType -2"
"anotherDocumentType -3"

I have no control over the schema or the names, so I can't make them "documentType -000001" for example. If I use the ordinary text sort, it'll break if there are 10 or more documents of the same type.

Is there some work-around to this, like maybe defining a custom sorting algorithm in the stylesheet?

Thank you,
Yuriy
[ July 08, 2005: Message edited by: Yuriy Zilbergleyt ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic