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 parsing

    Posted Wed August 20, 2008 07:37 AM

    Hi,

    I’m new to webMethods and have been trying to implement sample flow services. I’m trying to parse an XML to get all the tag names contained in the XML to a string list. I’m assuming that the flow will not know the number of tags contained in the document.
    This is how I went ahead with the solution…
    [HTML] getFile
    StringtoXMLNode
    Repeat (loop1)
    getXMLNodeIterator
    Repeat(loop2)
    getNextXMLNode
    Branch(on next/name)
    if next node is null then exit loop2
    else append tag name to string list, map the current node to next node[/HTML]

    Now the problem i’m facing… For this sample xml,

    [HTML]<?xml version="1.0"?>


    1
    2


    3
    4


    [/HTML]
    the expected output is

    Step1
    Step11
    Variable1
    Variable2
    Step12
    Variable3
    Variable4

    instead i get

    Step1
    Step11
    Step12
    Variable3
    Variable4

    The same holds good if i increase the number of tags in the same level. the iterator only picks up the inside tag names of the last tag in the same level. What am i doing wrong? Hope I have not been confusing in this post.

    Thanks.


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