[xquery-talk] xquery function

Mohamed kharrat med_khr at yahoo.fr
Sat Nov 20 11:24:28 PST 2010

dear all,
i want to create a function which return 1 or 0
i wrote this:
 declare function local:Match($X as xs:string*,$Y as xs:string*)

 for $tok in tokenize($X, "\s")
(:for $tok2 in tokenize($Y, "\s"):)

return if (some $l in tokenize($Y, "\s") satisfies $l= $tok(:contains 
($l,$tok):)) then 1
else 0
 local:Match('Cata avion nat voiture fff' , 'avion moto voiture') 
this function return not only "1" or "0" but a sequence of  0 1 0 1 0 
how to fix that?
i just want that this function verify if some word in "String1" contains in 
"String2" so in this case it  must return 1
thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20101120/d1ba679a/attachment.htm

More information about the talk mailing list