webMethods

webMethods

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.  not containsText wrong result

    Posted Mon September 13, 2010 03:29 PM

    declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
    (for $q in input()/NEWCRIM
    where not( tf:containsText($q/TFATTO/COM , ‘FIRENZE’) )
    return $q)

    the above query doesn’t return any records, but the next returns the correct result:

    declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
    (for $q in input()/NEWCRIM
    where not( $q/TFATTO/COM = ‘FIRENZE’ )
    return $q)

    This happens with every xml element.

    Does somebody knows why?

    thanx, Paolo


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: not containsText wrong result

    Posted Mon September 13, 2010 03:44 PM

    Hi Paolo,
    Depending of course on the content of the TFATTO/COM element of course.
    But if this is a text element that contains a lot of words among which FIRENZE may be alone or just one of many words, then a “NOT containsText” will reject all documents where firenze is the full or just part of the element.
    Compare this to the “NOT equals” in the second query, where only documents that contain the EXACT text “FIRENZE” are rejected.

    But from my point of view there would be a greater chance of elements being returned from the last query, because less documents are rejected.

    • exactly what you get ?!

    Or have I missed some important point ?
    Finn


    #webMethods
    #Tamino
    #API-Management


  • 3.  RE: not containsText wrong result

    Posted Mon September 13, 2010 04:03 PM

    Sorry I don’t specify that the element TFATTO/COM may contain only one word (‘FIRENZE’, ‘ROMA’, ‘MILANO’ …) and the containText operation without NOT returns the expected results, as well as the equal operation.

    But I don’t understand what happens with NOT.


    #Tamino
    #API-Management
    #webMethods


  • 4.  RE: not containsText wrong result

    Posted Tue September 14, 2010 08:46 AM

    I’m not sure I understand what you mean ?!
    The second query will only give you a match if “FIRENCE” and ONLY “FIRENCE” is the full content of the TFATTO/COM element.
    So does the second query without NOT give you what you expect ?
    Finn


    #Tamino
    #webMethods
    #API-Management


  • 5.  RE: not containsText wrong result

    Posted Tue September 14, 2010 10:43 AM

    Sorry for my bad english :oops:.
    Well the element TFATTO/COM contains only one word for each record so the containText and the equal operations give me the same values if arguments are the same.

    So does the second query without NOT give you what you expect ?
    yes, the returned result is what I expect.

    But the “not containsText” doesn’t work as I need, it doesn’t find any record.

    I tried the same queries with a simpler xml than the previous and all work as I expect.

    I actually don’t understand

    Thanx for replies :slight_smile:


    #webMethods
    #Tamino
    #API-Management


  • 6.  RE: not containsText wrong result

    Posted Tue September 14, 2010 10:50 AM

    Hi,

    could you please send an XML document that is leads to teh unexpected query result?


    #Tamino
    #API-Management
    #webMethods