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:containsText bug / question

    Posted Thu February 16, 2006 10:49 PM

    It seems Tamino have a bug with text
    I did the following experiment, based on a local report:

    for $a in input()/Establecimiento
    where tf:containsText($a/DefinicionEstablecimiento/Nombre, “SAN”)
    return $a/DefinicionEstablecimiento/Nombre

    it returns (OK)
    HOSP. SAN LUIS DE BUIN
    CONS. SAN JOAQUIN
    CONS. SAN BERNARDO

    Later I did:

    for $a in input()/Establecimiento
    where tf:containsText($a/DefinicionEstablecimiento/Nombre, “SA”)
    return $a/DefinicionEstablecimiento/Nombre

    But returns no results !! :shock:

    Originally I was trying to get some results with fn:starts-with, but it was a buggy function …

    How can I emulate fn:starts-with ??

    I have Tamino 4.4.1 WinXP Pro

    Joe


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: tf:containsText bug / question

    Posted Fri February 17, 2006 07:55 AM

    Hi,

    you did not encounter a bug, you just noticed correct behaviour of tf:containsText. This is a text retrieval function that searches for words and phrases. Apparently, there is no word “SA” in your database, so teh result is correct.
    Obviously, you want to search for all Nombre element which contain words starting with “SA” at any position of the element content. In this case, you have to specify that you do not want to search for whole words but for their prefix only. In tf:containsText, you can do this using the * wildcard:

    
    for $a in input()/Establecimiento 
    where tf:containsText($a/DefinicionEstablecimiento/Nombre, "SA*") 
    return $a/DefinicionEstablecimiento/Nombre 

    This wildcard can also be applied at the beginning or in the middle of a word.
    In your scenario, you will not find the names using “fn:starts-with()” - not because it is a buggy function, but simply because your element content DOES NOT start with “SAN”.
    You might find the Tamino documentation helpful in explaining this in more depth

    Regards

    Harald


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: tf:containsText bug / question

    Posted Fri February 17, 2006 01:42 PM

    Thanks Harald
    I’ll apply the wildcards for the containsText, but I did another test:

    for $a in input()/Establecimiento
    where tf:containsText($a/DefinicionEstablecimiento/Nombre, “H*”)
    return $a/DefinicionEstablecimiento/Nombre

    returns (OK)
    HOSPITAL DE PRUEBA
    HOSP. BARROS LUCO TRUDEAU
    HOSP. EXEQUIEL GONZALEZ CORTES
    HOSP. SAN LUIS DE BUIN

    for $a in input()/Establecimiento
    where fn:starts-with($a/DefinicionEstablecimiento/Nombre, “H”)
    return $a/DefinicionEstablecimiento/Nombre

    returns (BUG??)
    HOSPITAL DE PRUEBA

    for $a in input()/Establecimiento
    where fn:starts-with($a/DefinicionEstablecimiento/Nombre, “HOSP.”)
    return $a/DefinicionEstablecimiento/Nombre

    returns no results !! :shock:

    It seems a bug, that’s because I’m asking for some way to do starts-with with some tf:* function …

    Joe


    #Tamino
    #webMethods
    #API-Management


  • 4.  RE: tf:containsText bug / question

    Posted Fri February 17, 2006 05:09 PM

    Hi Joe,

    may I ask you to perform the following query:

    
    for $a in input()/Establecimiento where tf:containsText($a/DefinicionEstablecimiento/Nombre, "H*") return substring($a/DefinicionEstablecimiento/Nombre,1,1)

    If you get “H” four times, I agree that starts-with seems to have a bug

    Regards

    Harald


    #API-Management
    #webMethods
    #Tamino


  • 5.  RE: tf:containsText bug / question

    Posted Fri February 17, 2006 05:34 PM

    Harald
    It’s really weird:

    for $a in input()/Establecimiento where tf:containsText($a/DefinicionEstablecimiento/Nombre, "H*") return substring($a/DefinicionEstablecimiento/Nombre,1,1) 

    returns

    xq:valueH</xq:value>
    <xq:value />
    <xq:value />
    <xq:value />
    <xq:value />
    <xq:value />
    <xq:value />
    <xq:value />
    <xq:value />

    :?:

    Joe


    #Tamino
    #webMethods
    #API-Management


  • 6.  RE: tf:containsText bug / question

    Posted Fri February 17, 2006 05:36 PM

    Hi Joe,

    actually, that is what I had expected. It seems that your Nombre elements contain some non-printable character in form of the “H”.
    Please check with an editor that is capable of HEX display

    Regards

    Harald


    #webMethods
    #Tamino
    #API-Management


  • 7.  RE: tf:containsText bug / question

    Posted Fri February 17, 2006 05:48 PM

    Thanks Harald !

    It was a data problem I’m going to fix right now

    Joe


    #API-Management
    #webMethods
    #Tamino