[xquery-talk] Re: talk Digest, Vol 58, Issue 20
Jim Melton
jim.melton at acm.org
Wed Feb 27 09:31:19 PST 2008
At 2/27/2008 11:38 AM, gonzberg at gmx.de wrote:
>Hi all,
>I retrieve UTF-8 encoded Strings from my database with this XQuery:
>
>for $x in //text/country order by xs:string($x) ascending return xs:string($x)
>
>This is the result, it is not ordered like I expected:
>
>Deutschland
>Italia
>Oabcde
>Ägypten
>Österreich
>
>Is this the correct order according to a default collation?
XQuery defines the "default default" collation
(that is, the default collation in the spec that
can still be over-ridden by an
implementation-chosen default collation) to be
the Unicode Codepoint collation. The ordering
you see is exactly correct for the Unicode
Codepoint collation, because "Ä" has a codepoint
greater than "O" and "Ö" has a codepoint greater than "Ä".
>How would I order it like this (which would be standard for German language):
Check the documentation for your XQuery
implementation. If it offers a German language
collation, then the documentation will tell you
the specific URI used to identify that
collation. If it does not offer such a
collation, then I'm afraid the XQuery
Recommendation doesn't provide a way for you to
build your own (well, you can do so by writing a
user-defined external function that implements such a collation).
Hope this helps,
Jim
>Ägypten
>Deutschland
>Italia
>Oabcde
>Österreich
>
>Thanks a lot, Gonz
========================================================================
Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone: +1.801.942.0144
Co-Chair, W3C XML Query WG; XQX (etc.) editor Fax : +1.801.942.3345
Oracle Corporation Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive Standards email: jim dot melton at acm dot org
Sandy, UT 84093-1063 USA Personal email: jim at melton dot name
========================================================================
= Facts are facts. But any opinions expressed are the opinions =
= only of myself and may or may not reflect the opinions of anybody =
= else with whom I may or may not have discussed the issues at hand. =
========================================================================
More information about the talk
mailing list