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.  XQuery Problem

    Posted 07/16/07 05:08 PM

    Hello,

    Could anyone help with this?:

    I have been trying to execute the following query:

    declare namespace dia = “urn:mpeg:mpeg21:2003:01-DIA-NS”
    declare namespace xsi = “http://www.w3.org/2001/XMLSchema-instance
    declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
    for $q in input()/dia:DIA
    let $y:=$q/dia:Description/@xsi:type
    where $y = “AdaptationQoSType”
    return $q

    where it queries the following line from my .xml file:
    dia:Description xsi:type=“dia:AdaptationQoSType”

    and I get the error:
    “Invalid comparison;Types:QName,string”

    I understand that the types are not compatible with each other but is there any other way to run the query and verify the content of the xsi:type attribute?

    Thanks


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: XQuery Problem

    Posted 07/16/07 06:00 PM


  • 3.  RE: XQuery Problem

    Posted 07/16/07 06:16 PM

    does fn:get-local-name-from-QName return what you need here?


    #webMethods
    #API-Management
    #Tamino


  • 4.  RE: XQuery Problem

    Posted 07/16/07 06:51 PM

    Hi,

    with Tamino 4.4.1, the following works fine:

    
    declare namespace dia = "urn:mpeg:mpeg21:2003:01-DIA-NS"
    declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"
    
    for $q in input()/dia:DIA
    let $y:=$q/dia:Description/@xsi:type
    where $y = "dia:AdaptationQoSType"
    return $q 

    regards

    Harald


    #webMethods
    #Tamino
    #API-Management


  • 5.  RE: XQuery Problem

    Posted 07/18/07 11:02 AM

    Hello,

    thank you all for your replies. The version of my Tamino Server is 4.4.1.3, the following code didnt work in my system and generated the same error as stated in my first post:

    
    declare namespace dia = "urn:mpeg:mpeg21:2003:01-DIA-NS"
    declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"
    
    for $q in input()/dia:DIA
    let $y:=$q/dia:Description/@xsi:type
    where $y = "dia:AdaptationQoSType"
    return $q 

    finally, the solution was given using fn:get-local-name-from-QName (thanks Douglas Kelly) with the following code:

    
    declare namespace dia = "urn:mpeg:mpeg21:2003:01-DIA-NS"
    declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"
    declare namespace fn = "http://www.w3.org/2002/08/xquery-functions"
    for $q in input()/dia:DIA
    let $y:=$q/dia:Description/@xsi:type
    where fn:get-local-name-from-QName($y)="AdaptationQoSType"
    return $q

    #webMethods
    #Tamino
    #API-Management