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
Expand all | Collapse all

Handling namespaces in queryDocument service

  • 1.  Handling namespaces in queryDocument service

    Posted Tue July 16, 2002 01:18 AM

    My understanding of the w3c namespace specifications is that a child XML element inherits its namespace from its parent, unless the child’s namespace is explicitely overridden. As such
    -ford:car xmlns:myns=http://www.ford.com
    –ford:engine

    is equivalent to
    -ford:car xmlns:myns=http://www.ford.com
    –engine
    (just an example)

    I need to design queryDocument XQL queries that would extract the engine element, regardless of whether or not it was namespace-prefixed. I’ve tried several combinations of ‘nsDecls’ and XQL queries, but to no avail. Anybody have any insights?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Handling namespaces in queryDocument service

    Posted Fri September 12, 2003 10:12 AM

    Hi All,

    I am having a problem related to namespace. What I do not understand is that

    <soap-env:envelope>

    <soap-env:envelope>

    should be treated in the same way as

    <envelope>

    <envelope>

    by the pub.schema:validate function, or for that matter any function.

    It does not seem to be the case. Any help on usage of the namespace within webMethods would be most valuable.

    -Rajesh Rao


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Handling namespaces in queryDocument service

    Posted Fri September 12, 2003 06:06 PM

    Assuming the namespace of the soap-env prefix in
    <soap-env:envelope>

    </soap-env:envelope>

    is the same as the default prefix in

    <envelope>

    </envelope>

    They are logically the same as XML. If sending a node object to pub.schema:validate, both of these documents should pass validation.

    If you are sending the node object to xmlNodeToDocument and sending the Document (ie. the IData instance) to pub.schema:validate, if you don’t set the parameter that defines specific namespace->prefix mapping, then the created Document will have different field names for the two XML documents - this would cause a failure of pub.schema:validate. Having field names change for different documents would also cause Flow Maps to fail.

    See the nsDecls parameter of xmlNodeToDocument to define the prefix that should be created for each expected namespace, so the generated Document will have consistent names, independent of the incoming XML file.

    HTH,
    Fred


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods