[xquery-talk] Problems with string testing in if
jhunter at xquery.com
Tue Jun 1 01:50:26 PDT 2004
Sjur Nørstebø Moshagen wrote:
> I'm new to this list, my apologies if this posting is outside the
> intended scope.
It's right within scope.
> The problem is it does not work as expected. So far I have tried the
> input output
> ----- ------
> no nor
> se nor
> sme nor
> The function is:
> (: Convert incoming locale strings to 3-letter language codes (ISO 639) :)
> declare function fn:locale2lang($locale as xs:string) as xs:string
> let $lang := substring-before($locale,'_')
> if ($lang = "no" or "nn" or "nb") then "nor"
> else if ($lang = "se") then "sme"
if ($lang = "no" or $lang = "nn" or $lang = "nb") then "nor"
More information about the talk