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

To read text element (whose name is not fix) from document

  • 1.  To read text element (whose name is not fix) from document

    Posted 02/20/06 04:18 PM

    Hi I want to read the text element from document, but the element which I want to read is not fixed. The document contains only single element which is string,is there any way I can access the first element of the document.

    document
    –Field
    where Field can have different name.

    Thanks in advance.


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


  • 2.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 04:27 PM

    Hi Amit,

    Did you try to create a flat file schema with recordWithNoID as the name for record definition?

    -Pauly


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


  • 3.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 04:32 PM

    How is your document/Field name is dynamically changing?Basically you should atleast know the field name then you can map it accordingly to a temp variable if it exits.May be you can try with queryXMLNode service and do XQL query for the document field index 0 ?

    HTH,
    RMG


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


  • 4.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 04:34 PM

    No .
    I want to extract text element of the document , whose name is not fixed.
    is there any way I can access like %doc/0th element% as I do have only 1 element in my document.

    Thanks,


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


  • 5.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 04:40 PM

    I believe you should know the %doc/fieldname% then map works (not with 0th element or undefined name),have you tried with queryXMLNode if you have node in the pipe?


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


  • 6.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 04:55 PM

    Amit,

    You might want to use queryXMLNode with doc.?[0].text as the query(WQL).

    -Pauly


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


  • 7.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 05:07 PM

    Hi rmg,
    Thanks for immediate reply.
    Regarding %doc/fieldname% - here the fieldname is varying whose value comes against var1, so I can’t write the substitution like
    %doc/%var1%% . Plz correct me if I am wrong.

    I am trying to use the query XMLNode but not able to specify the query. I have mapped the document to nsDecls.After that I am not able to proceed. What will be the XQL query.
    I tried with doc[0].text . Can you correct me & add points if I am missing.

    Regards,
    Amit


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


  • 8.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 05:11 PM

    Can you post the document data? As I mentioned earlier you could use “?” if you do not know the filed name.

    -Pauly


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


  • 9.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 05:23 PM

    query=/rootnode/source() XQL should work with type XQL.Also see service documentation for more info.


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


  • 10.  RE: To read text element (whose name is not fix) from document

    Posted 02/20/06 05:31 PM

    Make sure you have selected WQL not XQL.

    -Pauly


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


  • 11.  RE: To read text element (whose name is not fix) from document

    Posted 02/21/06 02:31 PM

    Amit,

    You could use a Java service. Retrieve the ‘document’ IData from the pipeline, create an IDataCursor for it, call the method first() on the cursor to move it to the first element, then retrieve the value at that position.

    This should do what you want.

    • Percio

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


  • 12.  RE: To read text element (whose name is not fix) from document



  • 13.  RE: To read text element (whose name is not fix) from document

    Posted 02/21/06 02:43 PM

    Thanks a lot RMG , Pauly and Percio. I solved the problem.
    Thanks guys for immediate respnse & providing different options.

    Cheers,
    –Amit.


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


  • 14.  RE: To read text element (whose name is not fix) from document

    Posted 02/21/06 02:58 PM

    your welcome,Glad to know it is working…


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