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.  Help, please

    Posted 02/06/05 05:21 PM

    Can anyone help? Thanks in advance.

    I have the xml document like:



    12345A
    22345B
    32345A
    42345B
    52345B
    62345A
    72345A



    And like to transform it to another xml document. For all under , Start adding the folowing with when the last character of context of the is A; otherwise add the with the context when the last character of the context of the is “B”.



    12345A
    22345B


    32345A
    42345B
    52345B


    62345A
    72345B


    #Tamino
    #webMethods
    #API-Management


  • 2.  RE: Help, please

    Posted 02/11/05 12:04 PM

    Hi,
    I found this question to be quite a challenge because it requires procedural processing of your data, which does not sit comfortably with xsl’s declarative nature. I have attached an example which worked for me - I hope it gives you some ideas. Basically it steps through all the A items. For each A item it creates a new group and copies the A item. Then it locates the next A item, and explicitly copies all the B items which lie between the two A items. Before starting I had to remove whitespace from the xml because it interfered with the principle of node counting.

    I would hope that there is a better way to do this, but I couldn’t find one.

    HTH
    test.xsl (1.56 KB)


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: Help, please

    Posted 02/14/05 05:14 PM

    Here?s my solution. Remember, modes are our friends.
    group.xsl (1.31 KB)


    #API-Management
    #webMethods
    #Tamino