IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

XQuery tamino 4.1.4.1 search for pattern/regular expression.

  • 1.  XQuery tamino 4.1.4.1 search for pattern/regular expression.

    Posted Tue March 29, 2005 04:56 PM

    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]


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: XQuery tamino 4.1.4.1 search for pattern/regular expression.

    Posted Wed March 30, 2005 07:54 AM

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

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


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: XQuery tamino 4.1.4.1 search for pattern/regular expression.

    Posted Wed March 30, 2005 09:11 AM

    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.


    #Tamino
    #API-Management
    #webMethods