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
  • 1.  tf:highlight()

    Posted Tue January 13, 2004 09:12 AM

    Hi!

    I would like to use the highlight-function in a XQuery.

    Example-Query:

    declare namespace tf='http://namespaces.softwareag.com/tamino/TaminoFunction'
    for $b in input()/a
    where (tf:containsText($b/xy, 'Peter') or
    tf:containsText($b/xyz, 'Auto') or
    tf:containsText($b/abc, 'Hans') and
    tf:containsText($b/cde, 'IT') and
    $b/asdf="Unfall"
    return $b



    I would like to highlight “Peter, Auto, Hans and IT” in the query-result.

    How does it work?

    Bj


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: tf:highlight()

    Posted Tue January 13, 2004 11:11 AM

    Hello,

    I would have a look at the documentation for specific details, but essentially you need to create text references for the portions for highlighting with the tf:createTextReference() and then use the tf:highlight() function to produce a result with the ‘highlighting’. So your query becomes something like:-

      
    declare namespace tf='http://namespaces.softwareag.com/tamino/TaminoFunction'
    for $b in input()/a
    let $ref1 := (tf:createTextReference($b/xy, 'Peter'), 
    tf:createTextReference($b/abc, 'Hans'),
    tf:createTextReference($b/xyz, 'Auto'),
    tf:createTextReference($b/cde, 'IT'))
    where (
    tf:containsText($b/xy, 'Peter') or
    tf:containsText($b/xyz, 'Auto') or
    tf:containsText($b/abc, 'Hans') and
    tf:containsText($b/cde, 'IT') and
    $b/asdf="Unfall"
    )
    return tf:highlight($b, $ref1, "REV")



    Hope this helps.

    Stuart Fyffe-Collins
    Software AG (UK) Ltd.


    #API-Management
    #Tamino
    #webMethods


  • 3.  RE: tf:highlight()

    Posted Tue January 13, 2004 03:25 PM

    Hi!

    Thanks for your answer. It works.

    Bj


    #API-Management
    #webMethods
    #Tamino