XQuery tamino 4.1.4.1 search for pattern/regular expression.

Hi, i’m trying to write and make an xquery work… this query is supposed to return to me any elements/records that contain a certain set of characters… for example, if i want all the Product names that begin with the string “Ch”, it should give me


for $q in input()/Product
where $q/ProductDefinition[Name~=“Ch*”]
return $q

RETURNS:


Chapstick

Chandelear Chela Chacketa ---------------------------------------------------

This is precisely what i need to do and i haven’t found anything obvious on the web that can tell me if Tamino 4.1.4.1 is able to do this… can somebody please advise, maybe i have my query wrong or something else, its driving me nuts!..thank you in advance.[/img]

I suspect that the manual may help.
Please look at:

Tamino XML Server Documentation →
XQuery 4 Reference Guide →
Functions Ordered by Categories

Hi,
Mark is referring to the XQuery4 functions such as “xf:starts-with”, which you can use like this:


for $x in input()/Product
where starts-with($x/ProductDefinition/Name,"Ch") 
return $x

The “starts-with” function lives in the standard “xf” namespace in Tamino XQuery 4, so you don’t need to declare a namespace prefix when you use the function.