Use tf:containsText

Hi

How can i use the fonction tf:containsText in a JSP

i must declare

declare namespace tf="http://namespaces.softwareag.com/tamino/TaminoFunction"

but where and how???


Thanks

hi poussing,

it may well be me, but i don’t get the connection between a JSP and the acual XQuery.
what the beast usually looks like is this:

declare namespace tf="http://namespaces.softwareag.com/tamino/TaminoFunction"
for $a in input()/bib/book
where tf:containsText($a/title, "UNIX")
return $a


(to be found here in documentation: …/Tamino/Tamino 4.1.4.1/Documentation/xquery/xq-query-examples.htm#xq-fs-contains )

hope this helps.

gruss,
andreas f.

hi

but the problem is

this declaration make a error when i try it in a jsp

" declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction” "

hi poussin,

unfortunately i am fresh out of crystal balls, so you’ll have to elaborate a little. what exactly is the error? how does your actual code look like?

or, would it be as simple as a problem with quotes in a string? then your declaration has to look like this:

String myXQuery = "declare namespace tf=\"http://.../TaminoFunction\""
+ "for ... where ... let ..."



gruss,
andreas f.

Hi, poussin!

You have to declare the namespace directly at the begin of your query as andreas f. pointed out.

So somewhere you have your

http://localhost/tamino/mydb/collection?_xquery =[B]declare ...[/B] for ... where tf:containsText... 



Probably you have to write the blanks as %20 if you use it literally.