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.  XML document parsing behaviour with IS

    Posted Thu April 08, 2004 03:40 PM

    Hi,

    I am trying to parse XML document using pub.xml:xmlStringtoXMLNode and pub.xml:xmlNodeToDocument

    I have created an IS schema from a DTD and created a corresponding Document Type in IS. According to the structure of the document I do have several document lists inside my “global document”.

    To build the logic and navigate through my document, I make extensive use of the LOOP step to loop through my document lists.
    While testing my code, I found out that some times some of my LOOP steps were not executed in some situations. And after looking carefully to the XML, I found out that the resulted IS document after parsing didn’t contain a document list when there is only one element in the list which caused the LOOP not being executed.

    May be this is not very clear so here is an example:
    Let say you have an Order with several line items, parsing will give you

    Order
    LineItem
    LineItem[0]
    LineItem[1]

    where LineItem is a document list so that your LOOP works fine

    now, if you have only one line item in your XML document and even if the associated IS document defines LineItem as a document list, you will get

    Order
    LineItem

    Whiwh cause the LOOP not being executed, now if the parsing give something like

    Order
    LineItem
    LineItem[0]

    Even if there is only one element in your document list, the LOOP will be executed.

    I don’t know if someone had faced that “problem” before. Is this by design? or a bug in the parser? Is there any fix or do I have to write code to handle the 1 line item case separately!!

    Any feedback?

    For information, I am using IS 6.1 with Developer 6.1, is this a bug in version 6.1 or was it working fine with 6.0.1 and 4.6?


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


  • 2.  RE: XML document parsing behaviour with IS

    Posted Thu April 08, 2004 07:14 PM

    while using the pub.xml:xmlNodeToDocument service specify in the parameters set arrays (LineItem) and also set the documentTypeName that you are referencing.

    This will accomplishes your problem.

    Regards,


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


  • 3.  RE: XML document parsing behaviour with IS

    Posted Fri April 09, 2004 02:21 PM

    Thanks RMG,

    It worked fine by setting the documentTypeName in pub.xml:xmlNodetoDocument but you have to set the makeArrays property to false and arrays should be null.

    \Kacem


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


  • 4.  RE: XML document parsing behaviour with IS

    Posted Fri April 09, 2004 02:26 PM

    yes,i agree with you.In my posting i missed to mention the makeArray=false setting.

    Cheers


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


  • 5.  RE: XML document parsing behaviour with IS

    Posted Thu February 17, 2005 11:39 AM

    Hi,
    Even this is not working in my case.
    I have a very big doc type(Pip3A4 PO).I have the data even, I am trying to convert it to document using xmlNodeToDocument, setting makeArrays false and giving the doctype name.
    Even then, it is not giving me list elements.

    Can anyone help me in this.

    Thanks
    Muralidhar B


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