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.  Xml string to document

    Posted 11/24/05 09:40 AM

    Hi
    while converting XML string to document i need to convert attributes of elements also.
    but i am not able to that.
    Can someone tell me how to do that.
    Sandeep


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


  • 2.  RE: Xml string to document

    Posted 12/06/05 10:31 PM

    Sandeep,

    First, get the schema for the XML document you’re trying to convert from string format into a webMethods Document.

    Use the schema to create a webMethods Document type in your package.

    Then use the following to convert the XML document in string form into an instance of the webMethods Document type just created:

    pub.xml:xmlStringToXMLNode
    pub.xml:xmlNodeToDocument

    Map the output document to a docRef of the webMethods Document type created from the schema.

    This converts both attributes and child elements just fine.

    If you wish to validate the new XML Document against the schema, you can use the intermediate node that is created by pub.xml:xmlStringToXMLNode to call:

    pub.schema:validate

    • Pete

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


  • 3.  RE: Xml string to document

    Posted 07/07/10 12:19 PM

    Hi,
    I have the same situation, but…
    After I have Document (pub.xml:xmlNodeToDocument ) I need to get strings from this document.
    Could You tell me, please, how I can do it?
    I tried LOOP Input array: document <-but he didn’t want to go into LOOP. Maybe I am doing something wrong?
    Thank you,


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


  • 4.  RE: Xml string to document

    Posted 07/08/10 06:53 AM

    Sandy,
    You can also find it as String valiable with its name starting with @<attr_name> and its value assigned to it after nodeToDoc conversion. You can map it to any other field. Something similar to the attached. But be aware that this method can be followed only if the atrr_name is static or in other words you need to do the mapping for all the different attr_names present. For the later case it is better to follow pete’s suggestion.

    @vitalycrash,

    LOOP can enter only when it finds an array of the element during runtime that is mentioned in the inputArray property. Now the document that you have mentioned as inputArray is the output document of the nodeToDoc service whihc is not an array, it is just a container document. So you need to find out the repeating element in the XML that you need to exrtact and use it as the input array.
    xml_attr.png


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


  • 5.  RE: Xml string to document