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
  • 1.  Looping over XML Rows

    Posted Tue April 06, 2004 10:47 PM

    That’s the worst XML I’ve seen in a long time! ;o)

    You need 1 root tag (that encapsulates all other elements) and a repeating row/element would have the same XML node name - such as <row>.
    You could have <row id=“1”></row> or something but not unique element names like you’ve shown (row1, row2, etc).

    Get them to create proper XML!


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


  • 2.  RE: Looping over XML Rows

    Posted Wed April 07, 2004 12:13 AM

    Thanks Will.

    I can suggest that they change their XML to something that is better formed with repeating row’s, but I am unsure whether they will comply.

    Are there any webMethods services which can aid me in joining like-named tags into a record-list? Would a flat-file template help? We are using IS4.6


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


  • 3.  RE: Looping over XML Rows

    Posted Wed April 07, 2004 12:56 AM

    If you are saddled with using that XML, then here’s something that you may be able to do:

    Using REGEX or regular expressions, you can pass the entire XML string into the replace function and using the regex /^<row/>. Do this twice, once for <row_x> and then again for the closing tag </row_x>.

    Of course, change the search pattern for closing bracket /^</\row/

    It’s kinda crazy, but it may work.

    The best thing to do of course is to generate proper xml.

    Cheers.

    Ray


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


  • 4.  RE: Looping over XML Rows

    Posted Wed April 07, 2004 02:08 AM

    Satyen,

    This is not an XML file…It is a user defined flat file that looks like XML. If you can not get them to create a proper XML then defining the structure as a FF might be much easier.

    Good luck

    Alphan


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


  • 5.  RE: Looping over XML Rows

    Posted Wed April 07, 2004 03:45 AM

    Satyen - Alphan is onto something. This doesn’t seem to be XML at all - you can’t have tags defined on the fly like that. If your partner insists it is XML, ask them for the DTD or schema – tell them you require it to import the DTD as an WM record structure (which is true).

    Rays’ advice seems to be the best – use widlcards and pub.string:replace to transform the problem tags: <rownn> to plain old XML tags: <row>. If you want to preserve or extract the ‘NN’ number information, you could use the EDI adapter.


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


  • 6.  RE: Looping over XML Rows

    Posted Wed April 07, 2004 09:36 PM

    Thanks Guys!!

    I inisisted that our partner send us a DTD or XML Schema…and they suddenly agreed to ammend their XML structure!

    Now We have a record list of tblData!!

    Thanks for all the support, suggestions and guidance.

    Had they not changed, then the REGEX method sounds fairly simple, and a flat-file template might also be a good route too.


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