[xquery-talk] making a search case-insensitive

Cindy Girard clm6u at virginia.edu
Wed Jul 26 22:18:18 PDT 2006


Hi,

  I'm using Berkely XMLDB as my search database for one of my
  projects, and I can't seem to find anything that allows me to
  specify if I want the search case-sensitive or not. And it's
  case-sensitive by default.

  Well, I need it to be case-insensitive, so I'm trying to do it in
  the xquery instead.

  I have the following snippet:

 let $mixedkwd := (concat (upper-case(substring($keyword, 1, 1)), lower-case(substring($keyword, 2)))),
     $kwds := ($keyword or upper-case($keyword) or lower-case($keyword) or $mixedkwd),

     $hits :=
           for $entries in collection($collctn)//tei.2
                                         let $docname := concat($entries/@id, '.xml')
                                         let $text := $entries/text
                                         where contains($text, $kwds)
     

                                         

   I'm getting an ItemType matching failed error. Can someone correct
   my syntax, or is there a better way to do this?

   Thanks,
  
----- 
- Cindy  

Cynthia M. Girard
IATH, University of Virginia
clm6u at virginia.edu

"Danger? I laugh in the face of danger!
...and then I hide until it goes away."



More information about the talk mailing list