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.


#TechXchangePresenter
 View Only
Expand all | Collapse all

X-Query Is not working with nodes prefixed with Namespaces!

  • 1.  X-Query Is not working with nodes prefixed with Namespaces!

    Posted Sat October 28, 2006 06:43 PM

    Hi,
    I am regularly receiving an XML document from Adobe. The XML file refers to a namespace ‘aic’ (Adobe In Copy). After inserting the file as an instance to Tamino Server, the XML file will look something like this:

    <aic:document … ino:id=“1” …>
    aic:swatchlist
    .
    .
    .
    </aic:swatchlist>
    .
    .
    .
    </aic:document>
    When I query the XML DB from X-Query using the following simple query

    /aic:document [@ino:id=“1”]

    I get the intended result.

    However, (AND HERE IS THE PROBLEM)
    When I extended the above query to the following:

    /aic:document [@ino:id=“1”]/aic:swatchlist

    I get no result.

    Mind you that when I removed the namespace ‘aic’ from the entire document and reinserted again to the XML DB and queried it, the results were just fine.

    The question is:
    IS THERE ANY PROBLEM WITH HAVING A NAMESPACE IN AN XML DOCUMENT WHEN IT COMES TO X-QUERY ?


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: X-Query Is not working with nodes prefixed with Namespaces!

    Posted Mon October 30, 2006 11:36 PM

    X-Query is obsolete technology and in general doesn’t coexist well with namespaces. I’d strongly recommend using XQuery instead.

    declare namespace aic="whatever the namespace URL is"
    declare namespace tf="http://namespaces.softwareag.com/tamino/TaminoFunction"
    
    input()/aic:document[tf:getInoId(.) = 1]/aic:swatchlist

    #Tamino
    #webMethods
    #API-Management