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

How To Return the Document Excluding One of The Child Nodes

  • 1.  How To Return the Document Excluding One of The Child Nodes

    Posted Fri June 20, 2008 08:03 PM

    Hello,

    A sample document would be:

    Joe A 234 J st JJJJ 123456789 9099808990 JJJ@III.net

    How do I return the entire Customer document, except for a Secret child node, in the most efficient way?

    TIA.


    #webMethods
    #API-Management
    #Tamino


  • 2.  RE: How To Return the Document Excluding One of The Child Nodes

    Posted Thu July 10, 2008 04:21 PM

    Efficient is something strange, without the real data it is hard to challenge… You could use XSLT to transform the document and remove the element. For larger replies that is what I would go for.

    Otherwise:
    for $i in collection(“yourcollection”)
    where $i/Customer/Name=“Joe A”
    return {$i/Customer/Name/text()}…

    Just return everything this way but the Secret.

    Depends on the size of your application and the number of documents, I would expect this to be fast. But efficient?? Depends on what variables and benchmarks you are using. Transforming in a query is no fun, but XSLT isn’t either. Processing time I don’t know, you’d need to test it.


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: How To Return the Document Excluding One of The Child Nodes

    Posted Tue July 22, 2008 09:49 AM

    Or you could keep the “secret” document parts as a separate document type?


    #Tamino
    #API-Management
    #webMethods


  • 4.  RE: How To Return the Document Excluding One of The Child Nodes

    Posted Tue July 22, 2008 10:28 AM

    How about

    
    for $i in collection("yourcollection")/Customer
    where $i/Name="Joe A" 
    return ($i/* except $i/Secret)

    Regards

    Harald


    #webMethods
    #Tamino
    #API-Management