[xquery-talk] sorting problem

Torsten Schassan schassan at hab.de
Tue May 24 06:57:58 PDT 2011


Hi


considered strings like these:

11 Aug. 2°
10 Aug. 4°
3.1.1 Aug. 2°
A Aug. 2°
1 Weiss.


How would I sort them using XQuery according to this succession

- letters in the middle first (Aug etc)
- the sizes (2° etc)
- "front" letters before numbers
- numbers according to their position before the dots


Sorting result for the examples above would then be:

A Aug. 2°
3.1.1 Aug. 2°
11 Aug. 2°
10 Aug. 4°
1 Weiss.



Would that be done best with tokenize() or matches()?

Best, Torsten

-- 
Torsten Schassan
Digitale Editionen
Abteilung Handschriften und Sondersammlungen
Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
Tel.: +49-5331-808-130 (Fax -165), schassan {at} hab.de

http://www.hab.de/forschung/projekte/europeana-regia.htm
http://www.hab.de/forschung/projekte/weiss64.htm



More information about the talk mailing list