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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  How to split a string in Xquery?

    Posted 04/08/05 05:17 PM

    Hello, I am using Tamino 4.2.1.1 and I need to know how many words a string contains. So I search for the number of whitespaces using the following code:

    
    declare namespace fn="http://www.w3.org/2004/10/xpath-functions
    let $keyword := "lewis and clark"
    return fn:tokenize($keyword," ")

    But obviously this function is not supported by Tamino. Is there any other way I can get around? Help greatly appreciated.


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: How to split a string in Xquery?

    Posted 04/22/05 12:48 PM

    Hi,

    Unfortunately the tokenize() function is not supported by Tamino XQuery. But for counting the white-space separated substrings there exists a workaround. You can use the Tamino function tf:createTextReference() in the following way:

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

    count(
    let $keyWord := “lewis and clark”
    let $keyWordNode := {$keyWord}
    return tf:createTextReference($keyWordNode ,“*”)
    )

    Since tf:createTextReference() expects a node as first argument you have to wrap your keyword into an element node. Applied on this element with the pattern “*” the tf:createTextReference() function creates a text reference for each substring. So you can get the number of substrings by counting the created text references.

    Best regards,

    Thorsten Fiebig


    #webMethods
    #Tamino
    #API-Management


  • 3.  RE: How to split a string in Xquery?

    Posted 04/26/05 06:35 PM

    thanks a lot. It is very helpful.


    #API-Management
    #Tamino
    #webMethods