Case insensitive search


how do I do a case insensitive search? Obviously upper-case and lower-case are unsupported in 4.2, but what is a possible workaround?

More precisely, I’d like to do somethink like

where fn:upper-case($f/@name) = fn:upper-case('fooBar')



you can do so by specifying a case-insensitive collation

Thanks for the reply, Harald. Let’s extend the query:

fn:upper-case(@name)=fn:upper-case(‘fooBar’) and

How about that?

Here is an example that shows how to do a case insensitive compare:

for $e in (<e name="fooBar" value="BarFoo" />,
           <e name="FooBar" value="BarFoo" />,
           <e name="fooBar" value="barFoo" />,
           <e name="FooBar" value="barFoo" />)
where compare ($e/@name, 'fooBar', "collation?strength=secondary") = 0
  and $e/@value = 'barFoo'
return $e

The result is:

<e name="fooBar" value="barFoo"/>
<e name="FooBar" value="barFoo"/>

Tamino 4.4 includes support for fn:upper-case.